The tzparse Module

(Obsolete) The (highly incomplete) tzparse module contains a parser for time zone specifications. When you import this module, it parses the content of the TZ environment variable; Example 14-31 demonstrates.

Example 14-31. Using the tzparse Module
File: tzparse-example-1.py

import os
if not os.environ.has_key("TZ"):
 # set it to something...
 os.environ["TZ"] = "EST+5EDT;100/2,300/2"

# importing this module will parse the TZ variable
import tzparse

print "tzparams", "=>", tzparse.tzparams
print "timezone", "=>", tzparse.timezone
print "altzone", "=>", tzparse.altzone
print "daylight", "=>", tzparse.daylight
print "tzname", "=>", tzparse.tzname

tzparams => (EST, 5, EDT, 100, 2, 300, 2)
timezone => 18000
altzone => 14400
daylight => 1
tzname => (EST, EDT)

In addition to the variables shown in Example 14-31, this module contains a number of time manipulation functions that use the defined time zone.


Core Modules

More Standard Modules

Threads and Processes

Data Representation

File Formats

Mail and News Message Processing

Network Protocols

Internationalization

Multimedia Modules

Data Storage

Tools and Utilities

Platform-Specific Modules

Implementation Support Modules

Other Modules



Python Standard Library
Python Standard Library (Nutshell Handbooks) with
ISBN: 0596000960
EAN: 2147483647
Year: 2000
Pages: 252
Authors: Fredrik Lundh

Similar book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net