Move things around a bit to form logically arrange methods.

Fix some formatting.
Add TODO comment about a questionable method.
parent 3142054e
......@@ -32,6 +32,7 @@ class IDateTime(Interface):
# Conversion and comparison methods
#TODO determine whether this method really is part of the public API
def localZone(ltm=None):
'''Returns the time zone on the given date. The time zone
can change according to daylight savings.'''
......@@ -79,6 +80,10 @@ class IDateTime(Interface):
falls within the current minute, in the context of this
object's timezone representation"""
def isLeapYear():
"""Return true if the current year (in the context of the
object's timezone) is a leap year"""
def earliestTime():
"""Return a new DateTime object that represents the earliest
possible time (in whole seconds) that still falls within the
......@@ -149,10 +154,6 @@ class IDateTime(Interface):
__le__ = lessThanEqualTo
def isLeapYear():
"""Return true if the current year (in the context of the
object's timezone) is a leap year"""
def dayOfYear():
"""Return the day of the year, in context of the timezone
representation of the object"""
......@@ -277,30 +278,29 @@ class IDateTime(Interface):
# New formats
def fCommon():
"""Return a string representing the object\'s value in the
"""Return a string representing the object's value in the
format: March 1, 1997 1:45 pm"""
def fCommonZ():
"""Return a string representing the object\'s value in the
"""Return a string representing the object's value in the
format: March 1, 1997 1:45 pm US/Eastern"""
def aCommon():
"""Return a string representing the object\'s value in the
"""Return a string representing the object's value in the
format: Mar 1, 1997 1:45 pm"""
def aCommonZ():
"""Return a string representing the object\'s value in the
"""Return a string representing the object's value in the
format: Mar 1, 1997 1:45 pm US/Eastern"""
def pCommon():
"""Return a string representing the object\'s value in the
"""Return a string representing the object's value in the
format: Mar. 1, 1997 1:45 pm"""
def pCommonZ():
"""Return a string representing the object\'s value
"""Return a string representing the object's value
in the format: Mar. 1, 1997 1:45 pm US/Eastern"""
def ISO():
"""Return the object in ISO standard format. Note: this is
*not* ISO 8601-format! See the ISO8601 and HTML4 methods below
......@@ -332,6 +332,18 @@ class IDateTime(Interface):
The time is in UTC.
"""
def JulianDay():
"""Return the Julian day according to
http://www.tondering.dk/claus/cal/node3.html#sec-calcjd
"""
def week():
"""Return the week number according to ISO
see http://www.tondering.dk/claus/cal/node6.html#SECTION00670000000000000000
"""
# Python operator and conversion API
def __add__(other):
"""A DateTime may be added to a number and a number may be
added to a DateTime; two DateTimes cannot be added."""
......@@ -371,13 +383,3 @@ class IDateTime(Interface):
def __float__():
"""Convert to floating-point number of seconds since the epoch (gmt)"""
def JulianDay():
"""Return the Julian day according to
http://www.tondering.dk/claus/cal/node3.html#sec-calcjd
"""
def week():
"""Return the week number according to ISO
see http://www.tondering.dk/claus/cal/node6.html#SECTION00670000000000000000
"""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment