Time showing wrong

surya123
Mega Guru

Hi All

I am checking the time  on my incident record and it shows something different.

Incident is created at 02-14 02:49:35 PM

When i run a BG script, it shows the it as 2018-02-14 20:49:35

My timezone on user record is set to System.

Can someone tell me how can i get it correctly

 

Thanks

Surya

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Surya,

The values are stored in GMT. But when it is displayed on form/list it displays in user timezone.

Can you check what time zone is present in the system time zone.

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Central timezone. I see the same thing in Personal instance also. 

How can we get the time as it is in system format  ,how it was stored by system.

Paul Curwen
Giga Sage

Hi Surya,

 

In a Background Script getValue() will get it in UTC format and getDisplayValue() will get it in the user's time zone

 

See: https://old.wiki/index.php/Scoped_GlideTime_API_Reference#getDisplayValue.28.29

 

Regards,

 

Paul.

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

ccajohnson
Kilo Sage

The default date and time display formats are stored in a system preference. This preference can be overridden for an individual user. Check your profile, or user record to see what your date format is. Most likely it is set there. If not, go to System Properties > System and find the section called Date format.