Hi all,
How to convert server time (By Default SFMC using CST) to local time(Country Time Ex. IST)? and Through Local Time, I want to show the day of a Date.
Note:- Journey time and User time has set to IST.
4 个回答
Hi @Gourav Jain,
Try the SystemDateToLocalDate() function in AMPscript. This function converts a system datetime string or object to the current MC user's local time.
For Example:
%%[ SET @servertime = NOW() SET @localtime = SystemDateToLocalDate(@servertime) ]%%
Then to show the date based on local time you can use FormatDate().
For Example:
%%[ SET @day = FormatDate(@localtime, “dddd”, “”, “en-IN”) ]%%
Check out:
Date Time: System Date to Local Date | Marketing Cloud APIs and SDKs | Salesforce Developers
Date Time: Format Date | Marketing Cloud APIs and SDKs | Salesforce Developers
Good Luck!