We have a content fragment template which has date field and Time Zone dropdown. Now our requirement is that when the author selects a date and the time zone we want the date to be saved in the author selected time zone format.
For example , if author has entered date as "May 21,2021 11:29 am" and selected Time zone as "UTC+8: Hong Kong, Beijing, Kaula Lumpur" then instead of saving the date as "2021-05-21T11:29:00.000+05:30" it should be saved like "2021-05-21T11:29:00.000+08:00" which is author selected time zone format.
Please suggest if anyone has come up with the similar kind of use-case and solved it. Also the approach taken to achieve the same.
- rather changing the time and saving author specific time zone better to keep the server time zone (to keep common across for business logic and use cases) and calculate it based on client location while rendering the content. benefit we saw was a common client side solution to handle time zone difference and was applicable for any such rendering to content rather writing complex logic to figure out each different saved time zone according to author and then calculate these for a end user time zone.