Forums

{date:} returns date in wrong timezone

healyhatman 09 Apr, 2018
It's currently 9:32 AM, 10/Apr/2018 here in GMT+11 Australia. So 2018-04-10 09:34:00

{date:Y-m-d H:m:s} is giving me 2018-04-09 23:04:23 which is... what, UTC -0.5 ?

Either this is a bug, or there's a format string I should be adding to {date:} to get the time in the right format.
healyhatman 13 Apr, 2018
Answer
After digging through the code I found it.
{date/timezone:php_format$parameter}
Format strings are built using the date function parameters, see http://php.net/manual/en/function.date.php

So for example if I want the time in 12-hour format and date in dd-mm-yyyy 10 days and 3 hours from now in Australian Eastern Standard Time, with the timezone displayed and the ante/post mediridan (am/pm):
{date/AEST:h:i:s a d-m-Y  e$+ 10 days 3 hours}
Which currently gives me

02:04:36 pm 23-04-2018 Australia/Sydney
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount

{item:title} {images:#}