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


Groups > comp.lang.python > #24889 > unrolled thread

Re: simpler increment of time values?

Started byChris Angelico <rosuav@gmail.com>
First post2012-07-05 11:09 +1000
Last post2012-07-05 11:09 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: simpler increment of time values? Chris Angelico <rosuav@gmail.com> - 2012-07-05 11:09 +1000

#24889 — Re: simpler increment of time values?

FromChris Angelico <rosuav@gmail.com>
Date2012-07-05 11:09 +1000
SubjectRe: simpler increment of time values?
Message-ID<mailman.1805.1341450594.4697.python-list@python.org>
On Thu, Jul 5, 2012 at 10:29 AM, Vlastimil Brom
<vlastimil.brom@gmail.com> wrote:
> I'd like to ask about the possibilities to do some basic manipulation
> on timestamps - such as incrementing a given time (hour.minute -
> string) by some minutes.
> Very basic notion of "time" is assumed, i.e. dateless,
> timezone-unaware, DST-less etc.

My first suggestion would be to work with Unix times (that is, store
your time as "seconds since 1970", also called a time_t). That's
forced to be on UTC (but ignoring leap seconds) so you don't have to
worry about timezones or DST, and incrementing by X minutes is simply
adding X*60 to it. It makes your job a lot easier!

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web