Convert Time Zone

Converts the time from the current time zone to the requested time zone. If the time doesn’t contain a time zone, the value defined in Input Time Zone is used instead.

This action is available in API version 62.0 and later.

Supported REST HTTP Methods 

URI: /services/data/vXX.X/actions/standard/convertTimeZone

Where XX.X is the latest API version.

Formats: JSON, XML

HTTP Methods: POST

Authentication: Authorization: Bearer TOKEN

Where TOKEN is a variable.

Inputs 

InputTypeDescription
timestringRequired. The time that requires conversion. It can be with or without a time zone. The format for times that include a time zone is yyyy-MM-dd'T'HH:mm:ss.SSSXXX. For example, 2025-02-24T14:30:15.123-05:00. The format for times that don’t include a time zone is yyyy-MM-dd'T'HH:mm:ss.SSS. For example, 2025-02-24T14:30:15.123.
outputTimeZonestringRequired. The requested time zone. For example UTC.
inputTimeZonestringOptional. The time zone to use if the time doesn’t include a time zone. For example, America/Los_Angeles.

Outputs 

OutputTypeDescription
dateTimestringThe time after it’s converted to the required time zone, in the format yyyy-MM-dd'T'HH:mm:ss.SSSXXX. For example, 2025-02-24T14:30:15.123Z.

Example 

Sample request body:

1{
2  "inputs" : [{
3    "time" : "2025-02-24T14:30:15.123",
4    "outputTimeZone" : "UTC",
5    "inputTimeZone" : "America/Los_Angeles"
6  }]
7}

Sample response body:

1{
2  "actionName" : "convertTimeZone",
3  "errors" : null,
4  "isSuccess" : true,
5  "outputValues" : {
6    "dateTime" : "2025-02-24T22:30:15.123Z"
7  }
8}