TimeZone CreateUserTimeZone() Global Method

Returns the current user's TimeZone.

Function Signature

 TimeZone CreateUserTimeZone()

Parameters

Parameter Type Description

None

Return

Type Description

TimeZone

A TimeZone object based on the user's preferred time zone.

Technical Details

SBM ModScript version: 11.3.

Example

var tz = CreateUserTimeZone(); // result assumes user has MST time zone
var loc = CreateLocale("en_US");
var t = TimeT(1517620926);
Ext.WriteStream( t.FormatDateText("yyyy-MM-dd hh:mm:ss a", tz, loc ) );

Result:

2018-02-02 06:22:06 PM

Notes

This method creates a TimeZone object using the user's time zone. The TimeZone will change depending on who is logged in because the specified time zone depends on the user.

Related Topics

TimeZone