Darshan Hiranandani : Is it possible to store a timestamp with timezone formatting in my system?

Hi everyone,

I’m Darshan Hiranandani, facing an issue with saving date values from the frontend in the correct timezone format. Here’s what’s happening:

  • A user selects a date value like 08-08-2024 09:00 PM.

  • I attempt to save this value to the database formatted in either UTC or a specific timezone (e.g., America/Los_Angeles).

  • Despite the timezone formatting I apply, the value is stored exactly as received from the front end, 08-08-2024 09:00 PM.

I expected that saving the date as America/Los_Angeles (UTC -7) would convert and store it as 02:00 PM UTC, but that’s not the case.

Am I missing something in the process of converting and saving the date value? Any insights or suggestions on how to properly handle and store the date value with timezone adjustments would be greatly appreciated!

Thanks for your assistance!

Regards

Darshan Hiranandani

2 replies