0

I want to be able to store date-times with each row storing time zone too. Different rows can have different time zones. Like one event came from LA, another from NYC and a 3rd from Bangalore.

From the docs it seems the best way is to store the date part from Java in a date-time column and the time zone information in a varchar(10) seperate data base column or is there any better solution when we want different time zones in the same date-time attribute?

Reference : https://dev.mysql.com/doc/refman/5.5/en/datetime.html and How to store a datetime in MySQL with timezone info

tgkprog
  • 4,493
  • 4
  • 41
  • 70
  • 1
    I think best way to approach this problem storing time with 1 time zone and when needed convert it to the needed time zone programmaticly – Alper Fırat Kaya Dec 28 '17 at 16:35
  • 3
    -0800 is not a timezone. It's an offset. In my timezone, the offset is 1 hour in the winter, and 2 hours in the summer (this year, but it might change later). A timezone is, for example Europe/Paris. – JB Nizet Dec 28 '17 at 17:01
  • Is there a question? – Matt Johnson-Pint Dec 28 '17 at 18:51
  • Thanks, @jb-nizet okay will store actual time zone and not offset. So my main question is - the time zone string - do you suggest storing it as a varchar in another field? Or something else? – tgkprog Jan 04 '18 at 08:48

0 Answers0