Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

how to know the current user time zone?

sreenivassinsta
Tera Contributor

In how many ways we can find the current user time zone, and any user time zone?

1 ACCEPTED SOLUTION

Bhawana Upreti
Tera Guru

Hi,

You can try the given method.

gs.print(gs.getProperty("glide.sys.default.tz"));

If it's empty, it's America/Los Angeles

OR

var myUserObject = gs.getUser()
gs.print(myUserObject.getTZ()); -- returns the timezone of the current user

OR

var gdt = new GlideDateTime();
gs.print("Value : " + gdt.getUserTimeZone()); --TimeZone object for the current user.

To know more about timezone you can have a look at given link

Thank you!

View solution in original post

1 REPLY 1

Bhawana Upreti
Tera Guru

Hi,

You can try the given method.

gs.print(gs.getProperty("glide.sys.default.tz"));

If it's empty, it's America/Los Angeles

OR

var myUserObject = gs.getUser()
gs.print(myUserObject.getTZ()); -- returns the timezone of the current user

OR

var gdt = new GlideDateTime();
gs.print("Value : " + gdt.getUserTimeZone()); --TimeZone object for the current user.

To know more about timezone you can have a look at given link

Thank you!