CMS Development

JBrake
Contributor | Elite Partner
Contributor | Elite Partner

Current date and time in timezone

SOLVE

I am looking for a way to get the current time in a time zone, for purposes of checking a certain time has passed in that time zone. e.g. An event has already started or ended on this day in a certain timezone. 

 

"today('Pacific/Auckland')" provides the current day at 12:00AM and not the current time.

"to_local_time" and "local_dt" are base on the timezone setting of your portal, not a specified time zone. 

 

Advice appreciated.

0 Upvotes
1 Accepted solution
BarryGrennan
Solution
Top Contributor

Current date and time in timezone

SOLVE

Hi @JBrake 

{{local_dt | format_datetime('medium', 'Pacific/Auckland')}}

or 

{{local_dt | format_time('medium', 'Pacific/Auckland')}}

should do the trick.

 

See here for more details


profile2022aBarry Grennan

Freelance HubSpot CMS Developer

Website | Contact | LinkedIn

 

 

View solution in original post

2 Replies 2
BarryGrennan
Solution
Top Contributor

Current date and time in timezone

SOLVE

Hi @JBrake 

{{local_dt | format_datetime('medium', 'Pacific/Auckland')}}

or 

{{local_dt | format_time('medium', 'Pacific/Auckland')}}

should do the trick.

 

See here for more details


profile2022aBarry Grennan

Freelance HubSpot CMS Developer

Website | Contact | LinkedIn

 

 

JBrake
Contributor | Elite Partner
Contributor | Elite Partner

Current date and time in timezone

SOLVE

Woot! Thanks Barry... so obvious to me now! Hopefully the Regaine kicks in soon...

0 Upvotes