Question

FSM 6.24 Is there a way to use the user's local time instead of UTC as the default?

  • 30 June 2023
  • 5 replies
  • 97 views

Userlevel 1
Badge +3

Hi Team,

On the search screen, the date field gives the UTC date and time, Is there a way to use the user's local date and time instead of UTC as the default?

For reference, Adding the below screen shot.

 

Date Selected:

Script:

Gives UTC time:

 

 

Thanks

Venkat


5 replies

Userlevel 6
Badge +26

Hi @venkatesh 

Depends what you are trying to do. What is your target?

You can get the value with DB query and manipulate the value with the SQL script.

But generally speaking, it should not affect your script. But again, it depends.

Cheers!

Userlevel 1
Badge +3

Hi @Shneor Cheshin 

I really appreciate you taking the time to look into this issue. I am trying to update the database with the user's given date and time as their local time. Consider a scenario where a technician from the US enters the start date and end date. In this case, the system should store the date in local time; similarly, for India, it should be IST, and it goes on based on the technician's timezone. When I use a DB query, region input is required to store the date. is there a way, without providing input, we can store the user's local time? 

Note: Using client scripts, insert the record.

Thanks

Venkat

 

Userlevel 6
Badge +26

Hey @venkatesh 

The main question remians. What are you trying to achieve? What are the business requirments?

Storing the values in local time is not a goal, but a way to achieve something. Waht is it?

Why are you using client scripts to store values?

I think you need to elaborate in order for us to help you.

In any case, the date timezone should not be an issue.

PS, when I query the DB I date/time fileds in my local timezone. So not sure why you have an issue.

Cheers!

 

Userlevel 4
Badge +11

Hi @venkatesh,

is it related to offset time between summer time and winter time?

Userlevel 3
Badge +6

@venkatesh ,

I believe you are trying to store a time that is independent of time zone.  Meaning that it doesn’t matter what time zone a person is in, the field will always show the same value.  You should be able to control this by setting the proper Mask Type in the column metadata.  I don’t remember exactly, but the value to select is something like DATETIMENOTZ.

Reply