3 ms·
> [...] sometimes it is about the entity producing the data so should we not store that data, then? > The "Date" header in emails include the timezone (or UTC
by foxhill 4y ago
> [...] sometimes it is about the entity producing the data
so should we not store that data, then?
> The "Date" header in emails include the timezone (or UTC offset) of the sender [...]
i don't think that's strictly true - at best it may contain the timezone configured on the local machine when the e-mail was sent (what happens when you fly?), at worst it always contains UTC anyway for privacy concerns. in either case i don't think most people know this is a field that is transmitted, and it's presumably something the sending/recieving party likely already know each other (for personal communication)
> A SQL query that build a report of restaurant orders per hour needs to normalize for time of the day in local time [...]
i'd posit that that data should be stored principally then, surely?
fundamentally, why should the timestamp contain two data points? i wouldn't expect the database to have a single column for, say, my user id and registering user-agent string, so why would i expect it to combine a point in time with a vague location?
- nicolaslem 4y agoUltimately my comment was about entropy: a date with a timezone contains more information than a date alone. The technicalities about database columns, inaccuracies or privacy implications do not change this fact. I argued that keeping this information instead of discarding it is often useful and gave a few examples. I understand that sometimes systems can get by with only storing local dates or UTC dates but sometimes a system needs to be able to deal with both and keeping these extra bits of information is the only way.
- foxhill 4y agoof course, if you need it then you need it. i think the original commenters point only talks about how bad TSTZ is as a storage format, and that TAI is not only better than timestamp with time zone, but also UTC in almost every measure - something i agree with - not that time zones are useless. if you need the time zone to be recorded, i think the most sensible thing would be to record it independently.
- lowercased 4y agorecently did a project where some items were "future dates" - scheduled appointments for days/weeks/months in future, and were for entities in different time zones, and people making the appointments were occasionally in different time zones. The latter part was rare, but needed to accomodate that. Storing the appointment date/time as ... a date/time without timezone (timestamp without tz in postgres IIRC), then storing the timezone as a separate string - that gave enough flexibility to accomodate any situation that came up. "Wall time" - the date/time and tz separated - for future dates worked. Someone else wanted to store the date/time as 'utc timestamp' after the date had passed. "Wall time for future, UTC for past" was the motto, but... there wasn't a clear way of looking at the data to know which one you should be using immediately. I argued for consistency in the original data - if you want another view of it... make a db view that has the 'utc timestamp' conversion in it.
- mgkimsal 4y agoI've had pushback on items like this sometimes with the standard "YAGNI" excuse. A few months ago I came across some blog post describing the reverse: "YAGRI" - You Ain't Gonna Regret It. Just... store the extra data.
- iso1631 4y ago> it may contain the timezone configured on the local machine when the e-mail was sent (what happens when you fly?), at Most people have their system clock update automatically
- foxhill 4y agoindeed, but i don’t think they are able to retroactively update the time stamp of an already sent email :)
- iso1631 4y agoWhy would it? "It allows the recipient to know whether the email was written in the morning or the evening." I guess sure, you could write it in the morning then send it in the evening. Most people write and send at the same time, and thus most headers have the stamp of the time it was written.
- alphazard 4y agoThis guy gets it. Thank you for explaining better than I did. If someone wants to reveal their location, why wouldn't they include latitude as well? Location is a separate piece of information. If the idea is to give the reader an idea of where the sun was in the sky when the writer crafted the timestamp, isn't latitude also important?