AMPscript
LocalDateToSystemDate
Now
Retrieve
SystemDateToLocalDate
Validate Your Server-Side JavaScript using WSProxy
Converts a date-time value from the local time of the account or user to the system time for Marketing Cloud Engagement. The system time is Central Standard Time (CST) without adjustment for daylight saving time.
1LocalDateToSystemDate(1)| Ordinal | Type | Description |
|---|---|---|
1 | Date-Time | Required. A date-time string. |
The date that you provide to this function can use the formats listed in this table.
| Description | Example | Notes |
|---|---|---|
| ISO 8601 timestamp with milliseconds | 2025-08-05T12:34:56.789Z | Milliseconds and time zone offset are optional. |
| US date and time notation | 8/5/2025 12:34 PM | Single-digit numbers can optionally include leading zeroes. |
| Long-form notation | 5 August 2025 or August 5, 2025 | |
| Date and time | 2025-08-05 12:34:56 PM | |
| Time only | 14:23:56 PM | Returns the current date at the specified time. Can use 12-hour or 24-hour clock. |
| Chinese and Japanese notation | 2025 年 8 月 5 日 | |
| Korean notation | 2025년 8월 5일 |
The function doesn’t support these formats:
August 5th, 2025 or 5th August 2025.5/8/2025 to represent August 5, 2025.5 août 2025.٢٠٢٣/٨/٥.11 Av, 5785 or 11 Safar, 1447.To use the function, pass it a supported date-time string. This example uses the Now() function, which returns the current date and time.
1<script runat="server">
2 Platform.Load("Core","1");
3 var convertedDateTime = DateTime.LocalDateToSystemDate(Now());
4</script>
5<p><ctrl:eval format="F">convertedDateTime</ctrl:eval></p>The example returns the current date as a timestamp and as a formatted string. For example, if the local time for the user is August 5, 2025 at 12:34:56 PM Eastern Standard Time, the function outputs the system date and time.
1Tuesday, August 5, 2025 11:34:56 AM