On Aug 14, 2019, at 9:55 AM, Stephen Chrzanowski <pontia...@gmail.com> wrote: > > On Tue, Aug 13, 2019 at 7:30 PM J Decker <d3c...@gmail.com> wrote: > >>> Why are you storing the timezone? You display the TZ of the user who is, >>> later, viewing the data. And that user could be anywhere. >> >> Because the actual time on the clock on the wall matters. >> > The time on the clock is irrelevant, completely and totally, due to > daylight saving.
I agree with your reply as far as it goes, and I agree that times stored in the DB should be in UTC or some similar format. (By that I mean we don’t need to get into UTC vs UT1 vs whatever other “universal” time standard you prefer. Just pick one and stick to it for all users of that DB.) However, it *can* be helpful to store the time zone or the local UTC offset alongside the universal timestamp in the DB so you can translate the timestamp to local time in calculations. Without it, you can’t ask the DB questions like, “Give me all records that occurred between 9am and 10am local time,” or “Across all stores, what are our busiest hours?” The timestamp in UTC lets you ask different questions, such as “Give me the 10 most recent matching records,” which breaks if you store timestamps as local time, and your DB holds values from multiple time zones. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users