Finally, I got the right results, with many changes in my application. I did a lot of things to make this happen ... First, I used timezone.JS to get the list of time zones that will be used in the application, and use jstz to get the current time zone of the browser loading the page. Next, I have to do (for mvc) a method for obtaining a file that accesses time zones for loading in timezoneJS.
Then, while saving the time zone, I specified pst as a type, and then convert back to utc in roundtrip to update the interface.
When formatting my Json date, I run the timezoneJS method and get the timezone name from jstz and set the new date value like this:
var timezone = jstz.determine(); timezoneJS.timezone.zoneFileBasePath = '/Item/GetTz'; // get file method var dt = new timezoneJS.Date(parseInt(jsonDate.substr(6), timezone.name())); // strips out date from json date dt.setTimezone('America/Los_Angeles');
This allows you to run cloud projects on any server and display in any browser, regardless of the time zone, and also allows the user to view and configure data sensitive to the time zone from the beginning and allow users to see the start and end dates of the custom database values.
source share