Use in Salesforce Marketing Cloud
Call this API directly from any SFMC email or landing page using AMPscript. Four simple steps.
1
Set your values
Define the datetime to convert and the two timezones. Use IANA timezone names (same as the dropdowns on the left).
SET @utc = "2026-05-01 01:31:00" SET @from = "UTC" SET @to = "Australia/Melbourne"
2
Build the URL
Use URLEncode() on each value β it handles the %20 and %3A encoding automatically.
SET @url = CONCAT( "https://www.nerran.net/convert", "?utc=", URLEncode(@utc), "&from=", URLEncode(@from), "&to=", URLEncode(@to) )
3
Call the API
HTTPGet() makes the request and returns the full JSON response as a string.
SET @response = HTTPGet(@url)
4
Extract the result
Use REGEXMATCH() to pull any field from the JSON response β there is no native JSON parser in AMPscript.
/* Get the converted local datetime */ SET @localTime = REGEXMATCH(@response, '"local":"([^"]+)"', 1) /* Get the UTC offset (e.g. +10:00) */ SET @offset = REGEXMATCH(@response, '"offset":"([^"]+)"', 1) /* Check if DST is active (true / false) */ SET @dst = REGEXMATCH(@response, '"dst":(true|false)', 1)
β
Full example
Copy-paste ready. Replace the datetime and timezones with your own values or Data Extension attributes.
%%[ SET @utc = "2026-05-01 01:31:00" SET @from = "UTC" SET @to = "Australia/Melbourne" SET @url = CONCAT( "https://www.nerran.net/convert", "?utc=", URLEncode(@utc), "&from=", URLEncode(@from), "&to=", URLEncode(@to) ) SET @response = HTTPGet(@url) SET @localTime = REGEXMATCH(@response, '"local":"([^"]+)"', 1) ]%% %%=v(@localTime)=%% /* outputs: 2026-05-01 11:31:00 */
π¦ Full API Response
{
"local": "2026-05-01 11:31:00", β use this in your email
"local_iso": "2026-05-01T11:31:00+10:00",
"utc_equivalent": "2026-05-01 01:31:00",
"offset": "+10:00",
"dst": false,
"from_tz": "UTC",
"to_tz": "Australia/Melbourne"
}