Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35998

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

From roy@panix.com (Roy Smith)
Newsgroups comp.lang.python
Subject Re: Using mktime to convert date to seconds since epoch - omitting elements from the tuple?
Date 2013-01-02 12:27 -0500
Organization PANIX -- Public Access Networks Corp.
Message-ID <kc1qm2$mb7$1@panix2.panix.com> (permalink)
References <dfd18cf3-e2c0-4f0e-a4c1-a72924039a15@googlegroups.com> <roy-358706.09280402012013@news.panix.com> <mailman.1574.1357138278.29569.python-list@python.org>

Show all headers | View raw


In article <mailman.1574.1357138278.29569.python-list@python.org>,
Chris Angelico  <rosuav@gmail.com> 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.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Using mktime to convert date to seconds since epoch - omitting elements from the tuple? Victor Hooi <victorhooi@gmail.com> - 2013-01-02 00:01 -0800
  Re: Using mktime to convert date to seconds since epoch - omitting elements from the tuple? Vlastimil Brom <vlastimil.brom@gmail.com> - 2013-01-02 09:33 +0100
  Re: Using mktime to convert date to seconds since epoch - omitting elements from the tuple? Dave Angel <davea@dejaviewphoto.com> - 2013-01-02 09:06 -0500
  Re: Using mktime to convert date to seconds since epoch - omitting elements from the tuple? Roy Smith <roy@panix.com> - 2013-01-02 09:28 -0500
    Re: Using mktime to convert date to seconds since epoch - omitting elements from the tuple? Chris Angelico <rosuav@gmail.com> - 2013-01-03 01:51 +1100
      Re: Using mktime to convert date to seconds since epoch - omitting elements from the tuple? roy@panix.com (Roy Smith) - 2013-01-02 12:27 -0500
        Re: Using mktime to convert date to seconds since epoch - omitting elements from the tuple? Chris Angelico <rosuav@gmail.com> - 2013-01-03 04:34 +1100
        Re: Using mktime to convert date to seconds since epoch - omitting elements from the tuple? Dave Angel <d@davea.name> - 2013-01-02 12:44 -0500
  Re: Using mktime to convert date to seconds since epoch - omitting elements from the tuple? Barry Scott <barry@barrys-emacs.org> - 2013-01-03 23:46 +0000

csiph-web