Date/ Time Actual and Display value time difference.

Vishnu kumar R
Tera Guru

Hi,

 

I have tried sending Incident created Date/Time value thru Integration. Where I can able to see the display value time and backend time having 1 hour time difference. May I know the recent behind this and how can we send the time as what users seeing in incident form.

 

VishnukumarR_0-1685625152084.png

 

3 REPLIES 3

Manmohan K
Tera Sage

Hi @Vishnu kumar R ,

 

You can select whether you want time in UTC/GMT or you want time in user time zone as they can be different

To get time you see on incident form, use Local time code as shown below

var gdt = new GlideDateTime();
gs.info(' 1. UTC Time: ' + gdt.getValue());
gs.info('2. Local Time in user time zone: ' + gdt.getDisplayValue()); // Local TZ for this example is America/Los_Angeles

 

AmishRanjan2
Mega Guru

Hi @Vishnu kumar R ,

 

Try running this script after setting timezone of you profile timezone same as system timezone which would be available in system properties> Basic configuration>System timezone for all users unless overridden in the user's record. If the result still differs, then set your profile timezone as UTC and run the script. Please let me know if it works.

Best Regards,
Amish Ranjan

Harshal Aditya
Mega Sage
Mega Sage

Hi @Vishnu kumar R ,

 

Hope you are doing well.

 

Display Value -Date and time in the user's format and time zone. Keep in mind when designing business rules or script includes that this method may return values in different formats for different users.

 

Actual Value - Show time in UTC format

 

Please mark this response as correct or helpful if it assisted you with your question.

Regards,
Harshal