Back to index

python3.2  3.2.2
Classes | Functions | Variables
tzinfo-examples Namespace Reference

Classes

class  UTC
class  FixedOffset
class  LocalTimezone
class  USTimeZone

Functions

def first_sunday_on_or_after

Variables

tuple ZERO = timedelta(0)
tuple HOUR = timedelta(hours=1)
tuple utc = UTC()
tuple STDOFFSET = timedelta(seconds = -_time.timezone)
tuple DSTOFFSET = timedelta(seconds = -_time.altzone)
 DSTDIFF = DSTOFFSET-STDOFFSET
tuple Local = LocalTimezone()
tuple DSTSTART_2007 = datetime(1, 3, 8, 2)
tuple DSTEND_2007 = datetime(1, 11, 1, 1)
tuple DSTSTART_1987_2006 = datetime(1, 4, 1, 2)
tuple DSTEND_1987_2006 = datetime(1, 10, 25, 1)
tuple DSTSTART_1967_1986 = datetime(1, 4, 24, 2)
 DSTEND_1967_1986 = DSTEND_1987_2006
tuple Eastern = USTimeZone(-5, "Eastern", "EST", "EDT")
tuple Central = USTimeZone(-6, "Central", "CST", "CDT")
tuple Mountain = USTimeZone(-7, "Mountain", "MST", "MDT")
tuple Pacific = USTimeZone(-8, "Pacific", "PST", "PDT")

Function Documentation

def tzinfo-examples.first_sunday_on_or_after (   dt)

Definition at line 84 of file tzinfo-examples.py.

00084 
00085 def first_sunday_on_or_after(dt):
00086     days_to_go = 6 - dt.weekday()
00087     if days_to_go:
00088         dt += timedelta(days_to_go)
00089     return dt
00090 
00091 
00092 # US DST Rules
00093 #
00094 # This is a simplified (i.e., wrong for a few cases) set of rules for US
00095 # DST start and end times. For a complete and up-to-date set of DST rules
00096 # and timezone definitions, visit the Olson Database (or try pytz):
00097 # http://www.twinsun.com/tz/tz-link.htm
00098 # http://sourceforge.net/projects/pytz/ (might not be up-to-date)
00099 #
00100 # In the US, since 2007, DST starts at 2am (standard time) on the second
# Sunday in March, which is the first Sunday on or after Mar 8.

Here is the caller graph for this function:


Variable Documentation

tuple tzinfo-examples.Central = USTimeZone(-6, "Central", "CST", "CDT")

Definition at line 167 of file tzinfo-examples.py.

tzinfo-examples.DSTDIFF = DSTOFFSET-STDOFFSET

Definition at line 52 of file tzinfo-examples.py.

tzinfo-examples.DSTEND_1967_1986 = DSTEND_1987_2006

Definition at line 114 of file tzinfo-examples.py.

tuple tzinfo-examples.DSTEND_1987_2006 = datetime(1, 10, 25, 1)

Definition at line 108 of file tzinfo-examples.py.

tuple tzinfo-examples.DSTEND_2007 = datetime(1, 11, 1, 1)

Definition at line 103 of file tzinfo-examples.py.

tzinfo-examples.DSTOFFSET = timedelta(seconds = -_time.altzone)

Definition at line 48 of file tzinfo-examples.py.

tuple tzinfo-examples.DSTSTART_1967_1986 = datetime(1, 4, 24, 2)

Definition at line 113 of file tzinfo-examples.py.

tuple tzinfo-examples.DSTSTART_1987_2006 = datetime(1, 4, 1, 2)

Definition at line 107 of file tzinfo-examples.py.

tuple tzinfo-examples.DSTSTART_2007 = datetime(1, 3, 8, 2)

Definition at line 101 of file tzinfo-examples.py.

tuple tzinfo-examples.Eastern = USTimeZone(-5, "Eastern", "EST", "EDT")

Definition at line 166 of file tzinfo-examples.py.

tuple tzinfo-examples.HOUR = timedelta(hours=1)

Definition at line 4 of file tzinfo-examples.py.

tuple tzinfo-examples.Local = LocalTimezone()

Definition at line 79 of file tzinfo-examples.py.

tuple tzinfo-examples.Mountain = USTimeZone(-7, "Mountain", "MST", "MDT")

Definition at line 168 of file tzinfo-examples.py.

tuple tzinfo-examples.Pacific = USTimeZone(-8, "Pacific", "PST", "PDT")

Definition at line 169 of file tzinfo-examples.py.

tuple tzinfo-examples.STDOFFSET = timedelta(seconds = -_time.timezone)

Definition at line 46 of file tzinfo-examples.py.

tuple tzinfo-examples.utc = UTC()

Definition at line 20 of file tzinfo-examples.py.

tuple tzinfo-examples.ZERO = timedelta(0)

Definition at line 3 of file tzinfo-examples.py.