Is there any in-build feature from Service Stack, which will display dates and times in clients timezone?

Suppose the server is located in USA (UTC) and an user from Chennai (IST) is making a payment. Both the server and user are in different timezones. The UTC is 7 hours behind GMT (Greenwich Meridian Time) and the IST (Indian Standard Time) is 5.30 hours ahead of GMT, that is both the server and user have a time difference of 12:30 hours. If the user is making the payment on 9/20/2019 9:00 AM then the time at the server is 8/20/2019 8:30 PM. So which time you have to record in the database? If the application stores the user’s time in the database then if someone from US is seeing the transaction will likely see a wrong time i.e. 8/20/2019 8:30 PM. The other option is storing the server’s time in the database (that what we normally do), then the user will be unhappy seeing a wrong time.
Is there any feature provided by SS to support this ?

You can either apply an offset in backend based on their timezone if you record it in settings of do it based on their browser locale. Moment.js has some features to make this easy based on browser locale.

1 Like

Echoing @DigitalReach, I’d store Date’s in UTC and change what TimeZone to display the UTC in on the client.