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): ...@@ -32,6 +32,7 @@ class IDateTime(Interface):
# Conversion and comparison methods # Conversion and comparison methods
#TODO determine whether this method really is part of the public API
def localZone(ltm=None): def localZone(ltm=None):
'''Returns the time zone on the given date. The time zone '''Returns the time zone on the given date. The time zone
can change according to daylight savings.''' can change according to daylight savings.'''
...@@ -79,6 +80,10 @@ class IDateTime(Interface): ...@@ -79,6 +80,10 @@ class IDateTime(Interface):
falls within the current minute, in the context of this falls within the current minute, in the context of this
object's timezone representation""" 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(): def earliestTime():
"""Return a new DateTime object that represents the earliest """Return a new DateTime object that represents the earliest
possible time (in whole seconds) that still falls within the possible time (in whole seconds) that still falls within the
...@@ -149,10 +154,6 @@ class IDateTime(Interface): ...@@ -149,10 +154,6 @@ class IDateTime(Interface):
__le__ = lessThanEqualTo __le__ = lessThanEqualTo
def isLeapYear():
"""Return true if the current year (in the context of the
object's timezone) is a leap year"""
def dayOfYear(): def dayOfYear():
"""Return the day of the year, in context of the timezone """Return the day of the year, in context of the timezone
representation of the object""" representation of the object"""
...@@ -277,30 +278,29 @@ class IDateTime(Interface): ...@@ -277,30 +278,29 @@ class IDateTime(Interface):
# New formats # New formats
def fCommon(): 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""" format: March 1, 1997 1:45 pm"""
def fCommonZ(): 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""" format: March 1, 1997 1:45 pm US/Eastern"""
def aCommon(): 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""" format: Mar 1, 1997 1:45 pm"""
def aCommonZ(): 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""" format: Mar 1, 1997 1:45 pm US/Eastern"""
def pCommon(): 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""" format: Mar. 1, 1997 1:45 pm"""
def pCommonZ(): 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""" in the format: Mar. 1, 1997 1:45 pm US/Eastern"""
def ISO(): def ISO():
"""Return the object in ISO standard format. Note: this is """Return the object in ISO standard format. Note: this is
*not* ISO 8601-format! See the ISO8601 and HTML4 methods below *not* ISO 8601-format! See the ISO8601 and HTML4 methods below
...@@ -332,6 +332,18 @@ class IDateTime(Interface): ...@@ -332,6 +332,18 @@ class IDateTime(Interface):
The time is in UTC. 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): def __add__(other):
"""A DateTime may be added to a number and a number may be """A DateTime may be added to a number and a number may be
added to a DateTime; two DateTimes cannot be added.""" added to a DateTime; two DateTimes cannot be added."""
...@@ -371,13 +383,3 @@ class IDateTime(Interface): ...@@ -371,13 +383,3 @@ class IDateTime(Interface):
def __float__(): def __float__():
"""Convert to floating-point number of seconds since the epoch (gmt)""" """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