can we add time zone to the date/date variable in service request

Sharanya
Tera Contributor

Hi Team,

 

Hope you are doing well!

 

We have one variable which is target time/date filed where user can select the time. For Example :Target Date/Time: 2022-10-18 13:48:51

Now the requirement is depend on user time zone the value need to be added to the target date filed Example: Target Date/Time: 2022-10-18 13:48:51 GST.

 

can anyone help me?

 

Thanks,

Sharanya

3 REPLIES 3

Tony Chatfield1
Kilo Patron

Hi, perhaps you could explain your use case\business requirements, so that the reasons behind this requirement are better understood.

OOB Service now shows date\time to users in their defined time-zone, if you need to validate the time in another TZ you can simple switch your TZ via user preferences.

 

You could map your date\time field to a custom string field and append the tz, but I would not consider this advisable as it may cause confusion - who's time-zone is used when the field is updated?

 

If you want to see the time-zone of a user IE incident.caller, you could add the underpinning sys_user.time_zone field to your tasks form\list views.

 

Hi Tony,

 

we have one service request in which there is one date/filed type of variable .below is the screenshot.

Sharanya_0-1666090044590.png

when the user enter fill the time in the target date/field when there are submitting the SR.

after submitted the SR in the SC task description below is the screenshot they can able to see.

Sharanya_1-1666090169988.png

But now the requirement is whenever the user fill the date/filed variable in the SR depend on the time zone of user assigned. As we know that we have time zone in the user table depend on that time zone the value need to be populated to the target date/filed variable

For Example: In the second screenshot you have seen the only time and date value now below format need to be displayed in the SC task description. Depend on the user time zone it should be displayed

2022-10-18 13:48:51 GST.

I hope you are clear with the requirement.

 

Thanks,

Sharanya

Hi, I do not believe that date\time fields can be configured to show TZ (very happy if someone can provide details that indicate I am incorrect) and from a business perspective I would expect that my users knew the time-zone they are in so I do not see how this would be of benefit. Date\times are set in UTC and displayed to users in their chosen time-zone, so even if you set a TZ the date\time component would change based on logged in user.

As per my previous post a string field where a string of the date\time TZ is populated, based on assigned_to  field if required, would be the solution most likely to deliver meaning within the business.