summaryrefslogtreecommitdiffstats
path: root/Lib/calendar.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-06-17 12:38:10 (GMT)
committerGuido van Rossum <guido@python.org>1993-06-17 12:38:10 (GMT)
commit52fc1f607eab013b1e7688b4cfb3b09fb82ce9eb (patch)
tree33fed994c8981b8d1866362b1708c8d39916f1db /Lib/calendar.py
parent234f942aefb779efa6cfb7225e21d16a3f7e80f7 (diff)
downloadcpython-52fc1f607eab013b1e7688b4cfb3b09fb82ce9eb.zip
cpython-52fc1f607eab013b1e7688b4cfb3b09fb82ce9eb.tar.gz
cpython-52fc1f607eab013b1e7688b4cfb3b09fb82ce9eb.tar.bz2
* calendar.py: minor cleanups
* ftplib.py: support __init__ with optional host, port args * aifc.py: ensure header is written on close even when no data is written
Diffstat (limited to 'Lib/calendar.py')
-rw-r--r--Lib/calendar.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/calendar.py b/Lib/calendar.py
index a2bd398..160b8ba 100644
--- a/Lib/calendar.py
+++ b/Lib/calendar.py
@@ -9,11 +9,18 @@
# - the order of the elements of a 'struct tm' differs, to ease sorting
# - months numbers are 1-12, not 0-11; month arrays have a dummy element 0
# - Monday is the first day of the week (numbered 0)
+# - years are expressed in full, e.g. 1970, not 70.
+# - timezone is currently hardcoded
+# - doesn't know about daylight saving time
# These are really parameters of the 'time' module:
epoch = 1970 # Time began on January 1 of this year (00:00:00 UTC)
day_0 = 3 # The epoch begins on a Thursday (Monday = 0)
+# Localization: Minutes West from Greenwich
+timezone = -2*60 # Middle-European time with DST on
+# timezone = 5*60 # EST (sigh -- THINK time() doesn't return UTC)
+
# Return 1 for leap years, 0 for non-leap years
def isleap(year):
return year % 4 == 0 and (year % 100 <> 0 or year % 400 == 0)
@@ -97,10 +104,6 @@ def asctime(arg):
s = s + ' ' + dd(`hours`) + ':' + dd(`mins`) + ':' + dd(`secs`)
return s + ' ' + `year`
-# Localization: Minutes West from Greenwich
-timezone = -2*60 # Middle-European time with DST on
-# timezone = 5*60 # EST (sigh -- THINK time() doesn't return UTC)
-
# Local time ignores DST issues for now -- adjust 'timezone' to fake it
def localtime(secs):
return gmtime(secs - timezone*60)