Handling datetime format between client and db (local vs utc)

I have a react/ts project and im handling my dates currently as ISO strings but my api has datetime types as i need the time. If a user posts a record at a certain time the db converts it to utc time automatically it seems. So i have been dealing with the issue where records submitted at certain times are showing the wrong day when searching due to the time sync. Any advice about this would be helpful it has been driving me nuts lol.
1 Reply
fl0w
fl0w10mo ago
If I understand your question correctly… You could use UNIX /Epoch time stored in your db and convert that to the locale time (on the client)
Want results from more Discord servers?
Add your server