All Samples(340) | Call(338) | Derive(0) | Import(2)
tzset(zone) Initialize, or reinitialize, the local timezone to the value stored in os.environ['TZ']. The TZ environment variable should be specified in standard Unix timezone format as documented in the tzset man page (eg. 'US/Eastern', 'Europe/Amsterdam'). Unknown timezones will silently fall back to UTC. If the TZ environment variable is not set, the local timezone is set to the systems best guess of wallclock time. Changing the TZ environment variable without calling tzset *may* change the local timezone used by methods such as localtime, but this behaviour should not be relied on.
src/g/r/graphite-web-0.9.6/webapp/graphite/render/glyph.py graphite-web(Download)
limitations under the License.""" import os, cairo, math, itertools from time import strftime, localtime, timezone, altzone, daylight, tzset, mktime from calendar import timegm from urllib import unquote_plus from ConfigParser import SafeConfigParser
def tz_difference(tz): os.environ['TZ'] = tz tzset() captured_time = localtime() tz_delta = int(timegm(captured_time) - mktime(captured_time)) try:
src/t/e/testfixtures-1.8.0dev-r4464/testfixtures/tests/test_time.py testfixtures(Download)
# Copyright (c) 2008-2010 Simplistix Ltd # See license.txt for license details. import sample1,sample2 from os import environ from time import strptime, tzset from testfixtures import test_time,replace,compare,should_raise
def test_non_gmt_timezone(self):
try:
# setup
original=environ.get('TZ')
environ['TZ']='US/Eastern'
tzset()
del environ['TZ']
else:
environ['TZ']=original
tzset()
def test_suite():
return TestSuite((