Changeset 9afeb6 in indico
- Timestamp:
- 03/24/11 17:35:04 (2 years ago)
- Branches:
- master, burotel, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
- Children:
- bd2819
- Parents:
- d3adf1
- Location:
- indico
- Files:
-
- 2 edited
-
ext/livesync/chrome.py (modified) (1 diff)
-
util/date_time.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
indico/ext/livesync/chrome.py
r2a802b r9afeb6 173 173 174 174 def _tsToDate(self, ts, granularity): 175 return datetime.datetime. utcfromtimestamp(ts * granularity)175 return datetime.datetime.fromtimestamp(ts * granularity) 176 176 177 177 def _calculateTrackData(self, smanager): -
indico/util/date_time.py
rdfc79a r9afeb6 19 19 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 20 20 21 import time, pytz 21 import time, pytz, calendar 22 22 23 23 from MaKaC.common.timezoneUtils import nowutc 24 24 25 26 def utc_timestamp(datetimeVal): 27 return int(calendar.timegm(datetimeVal.utctimetuple())) 28 29 30 ## ATTENTION: Do not use this one for new developments ## 31 # It is flawed, as even though the returned value is DST-safe, 32 # it is in the _local timezone_, meaning that the number of seconds 33 # returned is the one for the hour with the same "value" for the 34 # local timezone. 35 25 36 def int_timestamp(datetimeVal, tz = pytz.timezone('UTC')): 37 """ 38 Returns the number of seconds from the local epoch to the UTC time 39 """ 26 40 return int(time.mktime(datetimeVal.astimezone(tz).timetuple())) 41 42 ##
Note: See TracChangeset
for help on using the changeset viewer.
