Kind of puzzled about timestamps

Joshua Judson Rosen rozzin at hackerposse.com
Mon Mar 8 14:00:12 EST 2021


On 3/6/21 7:46 PM, Ben Scott wrote:
> On Thu, Mar 4, 2021 at 9:57 PM Joshua Judson Rosen
> <rozzin at hackerposse.com> wrote:
>> And as a general word of advice from someone whose been burnt way too many times:
>> if you're going to put timestamps in your filenames, either just use UTC
>> or explicitly indicate which timezone the timestamps are assuming.
> 
> Even that's not enough, because the stupid humans keep changing what
> the time zones mean.  Say you find a file that has a stored time of
> 2007 MAR 31 17:00 UTC.  If that file was written before 2005, then the
> offset to US Eastern is 5 hours.  If that file was written after 2005,
> the offset is 4 hours.  Which did the human mean when they instructed
> the computer to write the file?  No way of knowing, in the general
> case.

Well..., I _did_ say "either... or...". The general idea is just `don't assume
that the reader will just know what scale/units you're using without it being declared'.

But some things that I really neglected to mention were:

	1) that "indicate which timezone" is itself actually multiple different approaches:
	   hours offset from UTC, or the _symbolic_ timezone that automatically adjusts
	   to changing politics.
	2) if you want to use those stamps to actually _convey information_, then
	   which one of _those_ you need depends on specifically what you're doing:
	   sometimes you want to indicate an actual point on the general timeline,
	   sometimes you want to indicate how something fits into the local schedule
	   or relates to `solar time' (e.g.: as a _nerd_, I thought it'd be a great idea
	   to set my digital cameras' clocks to UTC and just never deal with DST or
	   any other timezone issues when traveling..., and then as a _photographer_ I realized
	   what a lousy idea that could end up being...).
	3) sometimes you need to indicate _both_
	4) you might even need to give your symbolic timezone, your timezone offset, _and_ UTC..., _and_....

... BUT: even if you only do any arbitrary one of those things, at least you won't end up
mistakenly overwriting your records due to multiple distinct points in time
end up generating the same filename.

(the inverse issue, of whether you end up mistakenly _failing to generate collisions when you want to_
  can also be a concern of course; but I'd rather leave that as an exercise to the reader..., or to Ben ;p)

I *also* didn't even touch on how much all of this will annoy people who like nicely-sorting filenames... ;p

Every once in a while, I go back to try to find a solution to all of the other problems that also
fits in with _that_, and just fail. Basically..., whenever anyone asks me "what time is it?".
And I think I've been at that for 10 years now....


More information about the gnhlug-discuss mailing list