Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: simpler increment of time values?

Reply
Thread Tools

Re: simpler increment of time values?

 
 
Chris Angelico
Guest
Posts: n/a
 
      07-05-2012
On Thu, Jul 5, 2012 at 10:29 AM, Vlastimil Brom
<> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
simpler increment of time values? Vlastimil Brom Python 5 07-06-2012 02:34 AM
Re: simpler increment of time values? Vlastimil Brom Python 0 07-05-2012 01:18 PM
Re: simpler increment of time values? Devin Jeanpierre Python 0 07-05-2012 05:05 AM
Re: simpler increment of time values? Jason Friedman Python 0 07-05-2012 04:57 AM
Re: simpler increment of time values? Mark Lawrence Python 0 07-05-2012 02:35 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57