Im able to achieve getting date format to server time(LocalDateToSystemDate(@currentSystemTime)) or user time(now()) in ampscript. But i want this date format to be convert to sydney time how can we achieve?
-
I can help you here. However, before I answer your question, is the time zone of the Business Unit (as defined in Administration > Account Settings) set to Sydney time? And if not, what Marketing Cloud stack are you on? e.g. s7, s8, s10, etc (I need to know, as my answer will differ depending on the stack).– Eliot HarperCommented Aug 13, 2018 at 19:04
Add a comment
|
1 Answer
You can use the FormatDate function in AMPscript.
If you change the en_US to en_AU in the given example to get the time in Australia, it does the trick.
edit: In the end, you should use the below function; first parameter is the date you wish to convert:
%%=FormatDate("2012-10-05 03:21:34.567890", "MMM DD, YYYY", "HH:MM:SS.MMM", "en-AU")=%%
-
Please include a summary of the answer from the link as links often break when Salesforce rearrange their documentation. Commented Aug 13, 2018 at 11:06
-
The
en-AU
argument in the FormatDate function will not magically set the date to Sydney time. There are 7 different timezones in Australia. This parameter simply defines the ISO locale code for the output. Commented Aug 13, 2018 at 19:01