| Parlante |
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance("US/Pacific")
- eastext/ht |
Sat, 09 Apr, 03:30 |
| Parlante |
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance("US/Pacific")
- eastext/ht |
Sat, 09 Apr, 03:30 |
| Parlante |
[No Subject] |
Sat, 09 Apr, 03:30 |
|
ange limits and
- # MAXYEAR/MINYEAR, since a now timestamp really shouldn't be outside those
- # ranges
- new_timestamp = timegm(timetuple)
-
- activity.Time.auto_update = False
- activity.Time.advance(new_timestamp - activity.Time._now)
-
-def resetNow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- """The number of seconds betwen the UTC epoch and now."""
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return "FloatingTZ(%r)" % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance("US/Pacific")
- eastext/ht |
Sat, 07 Apr, 02:32 |
| m.@osafoundation.org> |
ow():
- activity.Time.auto_update = True
- activity.Time.tick()
-
-def nowTimestamp():
- """The number of seconds betwen the UTC epoch and now."""
- return activity.Time._now
-
-class TimeZone(trellis.Component, context.Service):
-
- default = trellis.attr(ICUtzinfo.default)
-
- @trellis.perform
- def save_default(self):
- ICUtzinfo.setDefault(self.default)
-
- class _FloatingTZInfo(ICUtzinfo):
- def __init__(self): pass
-
- def utcoffset(self, dt):
- return TimeZone.default.utcoffset(dt)
-
- def dst(self, dt):
- return TimeZone.default.dst(dt)
-
- def __repr__(self):
- return "FloatingTZ(%r)" % (TimeZone.default,)
-
- floating = _FloatingTZInfo()
-
- def __getitem__(self, key):
- result = ICUtzinfo.getInstance(key)
- if result.tzid == 'GMT' and key != 'GMT':
- return None
- else:
- return result
-
-
- ### Helper constants
- pacific = ICUtzinfo.getInstance("US/Pacific")
- eastext/ht |
Mon, 03 May, 09:42 |