When creating a custom module, HubSpot offer two datetime fields:
- Date - a simple datepicker where the content editor can select the date
- Date and Time - a field in which the content editor can select both the date and time (at intervals specified in the module)
What timezone is used?
When you populate a default value or if a content editor populates the field, the timezone used is the account timezone, which you'll find under Settings > Account Defaults by clicking into the General tab > "Time zone":
Regardless of where the content editor is located, this is the timezone that will be set.
(To confirm this, I tested populating the value using a VPN located elsewhere).
What timezone is displayed?
When a user visits a page that contains a module with a Date or Date and Time field, the timezone displayed will also be the account timezone.
Using filters to format the date/time and their effect on timezones
You can use the format_date or format_datetime filters to modify the format of your date and time.
However, one thing I've noticed is that, even though the documentation says that the timeZone parameter is optional, if you don't include the timeZone parameter and only use the format parameter, it will default to GMT timezone.
(This was not the case with the deprecated filter datetimeformat).
Therefore, you'll want to set the timezone in your filter.
Written by: Stephanie O'Gay Garcia Last Updated: March 2, 2023