Two conversion methods are available for dates. See Date Object Overview for more information on timezones on Forsta Plus servers.
valueOf
dateObj.valueOf()valueOf returns the stored time value in milliseconds since midnight, January 1, 1970 UTC.
toLocaleString toString and toUTCString
dateObj.toLocaleString()toLocaleString returns a date converted to a string using the current locale. This mean that it will give the Forsta Plus server time, and the date is formatted according to the Regional Settings on the server.
dateObj.toUTCString()
toUTCString returns a string that contains the date formatted using Universal Coordinated Time (UTC) convention.
dateObj.toString()toString returns the textual representation of the date, in the time of the Forsta Plus server, but not reflecting the locale settings.
Here is an example of the output from the three different methods from a server with English (United States) as locale and where the time zone is EST (such as Forsta's Forsta Plus ASP servers):
Method |
Output |
| toUTCString | Sat, 1 Jan 2000 00:00:00 UTC |
| toLocalString | Friday, December 31, 1999 7:00:00 PM |
| toString | Fri Dec 31 19:00:00 EST 1999 |
Note: The toGMTString() method is obsolete (and only available in the jscript .NET engine). Use the toUTCString() method instead. Using toGMTString() in the JavaScript Engine will result in an error.