|
|
Log in / Subscribe / Register

Quote of the week

Quote of the week

Posted Nov 20, 2013 14:54 UTC (Wed) by jzbiciak (guest, #5246)
In reply to: Quote of the week by robbe
Parent article: Quote of the week

Wall clock time from whose perspective, though? The perspective of the viewer, or the perspective of the person who generated the time stamp?

If I do an `ls` on a Linux or UNIX box, it generally shows me time stamps from my own perspective, regardless of the time zone that was set for the task that created / updated the files.

(I say 'generally', because I don't really remember what rules Linux applies to a FAT volume that has files stored with local-time timestamps.)

I'm not against marking clearly that a timestamp is in UTC. Recording the timezone of the person generating the timestamp only really effectively adds location information, and if it isn't stored as a simple offset to UTC, it also requires me to consult a timezone database to interpret it correctly. If I want to compare two timestamps and determine "newest," plain UTC is the simplest.

We actually had a timezone related date problem at work a few years back. We had a "results" database that we used to collect performance analysis figures, so we could monitor the performance of a design as it progressed. We wanted to detect any performance regressions and track them to a particular release. The early database design just stored when the results were measured. It worked well enough until we brought on some contractors in India to help our Dallas-based team. We started getting "time traveling" data, because the timestamps were stored in local-time.

We ended up switching to UTC. (My response was almost exactly as above: "Why are we storing that in localtime? Store it in UTC and be done with it!") We also put some additional columns in there to grab the exact design release tag and the release tag for the analysis scripts, because that timestamp was just a little too overloaded for what we were using it for. (Growing pains...)


to post comments

Quote of the week

Posted Nov 21, 2013 16:22 UTC (Thu) by robbe (guest, #16131) [Link] (1 responses)

> Wall clock time from whose perspective, though?

Where the event happened. I had something like an event database in mind. Let's say a sensor reading is out of bounds and you want to store that. My point is that, three years later, when the court case is running, you would want to correlate the DB contents with the paper logbook that a worker keeps (in wall clock time, of course!). You would probably be able to, as said worker will be in a definite location with a definite timezone, but storing the offset alongside UTC would make it easier still. And it's only eight bit (seven if you're a miser)!

File systems are an interesting case. We would have to store the timezone offset of the current process updating a file along the utc mtime. Problem being, the timezone is a userland-only concept...

Quote of the week

Posted Nov 21, 2013 17:24 UTC (Thu) by jzbiciak (guest, #5246) [Link]

Storing the offset for the location of the event makes sense if you need to quickly contextualize back into the context where the reading was made, sure. I still vote for recording UTC + offset as opposed to localtime + offset. If you've ever tried to interpret timestamps in SMTP headers, it can be rather confusing for email crossing multiple timezones.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds