function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
geardrivegeardrive 

Issues with time Zone.

Hi all

I am stuck with a wierd problem

 

The organizational time zone in the my system is set to EST. The users to the system can have any local time zone as set by the System Admin while the creation of the user record or changed by the user himself during any course of time. As per salesforce OOTB the system will shown the datetime fields to the user in the local user setting time but all the records in the SF database are stored in the organizational time zone(EST). This may lead to the date offset because of the time difference in the local user setting and the organization wide setting. This date offset will further lead to issues in the time sensitive business processes.

 

Is there a way of avoiding the date offset in datetime fields. As of now i am planning to keep corresponding String fields (populated by trigger / formula ) and then use these fields for the date time sensitive processes.

 

Please suggest, any suggestions will be greatly appreciated.

Regards

Roshan Rao

werewolfwerewolf
Actually all datetimes in Salesforce.com are stored in GMT, not the org's time zone.  When a user views the datetimes, those datetimes are adjusted to reflect that user's time zone.
geardrivegeardrive

Ok lets say it is in GMT.

 

But how do i prevent the date offset for the date time fields in my system. I want the date time field to stay as is irrespective of the local time zone.

 

Can this be achived ?

 

Regards

Roshan Rao

werewolfwerewolf

Normal datetime fields don't do that.  They always adjust themselves to the local time zone.

 

Maybe you can make a custom text field, and copy the datetime to that field in textual form when that field is set using a workflow field update?

geardrivegeardrive

Thats what i am thinking to do as of now. but i was thinking if i can achive the same by some other way through which i will not have to change my underlying code or prevent the duplicasy of data in the system.

 

anyways i am not able to figure out anything else. i will go ahead with custom string implementation.

thanks a lot werewolf for the help.

 

Regards

Roshan Rao