Added IDateTime interface

parent 8d432293
......@@ -19,6 +19,9 @@ import re, math, DateTimeZone
from time import time, gmtime, localtime
from time import daylight, timezone, altzone, strftime
from datetime import datetime
from interfaces import IDateTime
from interfaces import DateTimeError, SyntaxError, DateError, TimeError
from zope.interface import implements
default_datefmt = None
......@@ -40,19 +43,6 @@ try:
except:
tzname=('UNKNOWN','UNKNOWN')
class DateTimeError( Exception ):
pass
class SyntaxError( DateTimeError ):
pass
class DateError( DateTimeError ):
pass
class TimeError( DateTimeError ):
pass
# To control rounding errors, we round system time to the nearest
# millisecond. Then delicate calculations can rely on that the
# maximum precision that needs to be preserved is known.
......@@ -492,6 +482,8 @@ class DateTime:
and numeric operations return a new DateTime object rather than
modify the current object."""
implements(IDateTime)
# For security machinery:
__roles__=None
__allow_access_to_unprotected_subobjects__=1
......
This diff is collapsed.
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