[Tutor] Time - sum/difference

Hugo González Monteverde hugonz-lists at h-lab.net
Sat Oct 22 21:38:29 CEST 2005


What I usually do is convert them all to UNIX epoch and then substact 
the values in seconds:

 >>> import time
 >>> early = time.time()
 >>> sleep(5)
 >>> time.sleep(5)
 >>> late = time.time()
 >>> print late - early
5.7889997959
 >>>


Jonas Melian wrote:
> I would get the local time of a country, using UTC (Universal Time 
> Coordinated) and DST (Daylight SavingTime) of that country.
> 
> An example, utc time -02:30 and dst +1 :
> 
> country_utc = datetime.time(2,30)
> isUTCNegative = True
> dst = datetime.time(1,0)
> 
> Now I would the difference of both times.
> -02:30 + 01:00 -> -01:30
> 
> Is possible get sum/difference of time values? How?
> 
> Thanks in advance
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 


More information about the Tutor mailing list