Date

This document describes the Date object in the JavaScript environment for app serivices.

In general the standard Date object of the JavaScript interpreter is used. But we added some specific implementations that differ from the standard. Those are described in this document.

Table of content

Object Date
Functions toLocaleString

Date

toLocaleString
This function can be used for time zone conversions.

Parameters

localeCurrently not used. Always a date string in ISO format will be returned.
optionsAn object containing a string timeZone, e.g. { timeZone: "Europe/Berlin" }

Return value

stringThe full date string in ISO format. Can be parsed using new Date(isoString) to restore the excact time.
var now = new Date();
log("ISO:      " + now.toISOString());
log("ISO:      " + now.toLocaleString());
log("New York: " + now.toLocaleString(null, {timeZone: "America/New_York"}));
log("Berlin:   " + now.toLocaleString(null, {timeZone: "Europe/Berlin"}));
log("Tokyo:    " + now.toLocaleString(null, {timeZone: "Asia/Tokyo"}));
Example output:
ISO:      2025-05-30T12:02:03.652Z
ISO:      2025-05-30T12:02:03.652Z
New York: 2025-05-30T08:02:03.652-04:00
Berlin:   2025-05-30T14:02:03.652+02:00
Tokyo:    2025-05-30T21:02:03.652+09:00