Using mktime to convert date to seconds since epoch - omitting elements from the tuple?

Roy Smith roy at
Wed Jan 2 18:27:30 CET 2013

In article <mailman.1574.1357138278.29569.python-list at>,
Chris Angelico  <rosuav at> wrote:

>> I assume you mean timestamps. A date doesn't need to worry about UTC
>> the way a timestamp does.

I'm not sure how a date and a timestamp differ in any significant
way.  A date is just a very low-precision time.

>> 3) Run all your servers with their timezones set to UTC.
> Not strictly necessary imo; as long as your application knows that it
> needs to work in UTC, it doesn't matter what the OS works in. But yes,
> it is a convenience.

Many small conveniences add up to conservation of sanity :-)

I suppose what's really essential is a way to quickly see the current
UTC time.  That way, when you're looking at some event in a log file,
it's easy to figure out, "that was 20 minutes ago", as opposed to,
"that was 5 hours and 20 minutes ago".  I run my desktop in New York
time (so I know when I'm supposed to eat lunch), but I also have a
second clock widget displaying UTC time just below it.  Right now,
it's 17:22.

More information about the Python-list mailing list