m .Ec@sdZdklZdefdYZdefdYZdefdYZdefd YZd efd YZd S( sNDateTime interfaces $Id: interfaces.py 40388 2005-11-28 14:53:55Z philikon $ (s Interfacet DateTimeErrorcBstZRS(N(t__name__t __module__(((t2/data/zmath/zope/lib/python/DateTime/interfaces.pyRst SyntaxErrorcBstZRS(N(RR(((RRst DateErrorcBstZRS(N(RR(((RRst TimeErrorcBstZRS(N(RR(((RRst IDateTimecBstZddZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZeZdZeZdZeZdZeZdZeZdZeZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'd Z(d!Z)d"Z*d#Z+d$Z,d%Z-d&Z.d'Z/d(Z0d)Z1d*Z2d+Z3d,Z4d-Z5d.Z6d/Z7d0Z8d1Z9d2Z:d3Z;d4Z<d5Z=d6Z>d7Z?d8Z@d9ZAd:ZBd;ZCd<ZDd=ZEd>ZFd?ZGd@ZHdAZIdBZJdCZKdDZLdEZMeMZNdFZOdGZPdHZQdIZRdJZSdKZTdLZUdMZVRS(NNcCsdS(siReturns the time zone on the given date. The time zone can change according to daylight savings.N((tltm((Rt localZone$scCsdS(sReturn the date/time as a floating-point number in UTC, in the format used by the python time module. Note that it is possible to create date/time values with DateTime that have no meaningful value to the time module.N((((RttimeTime(scCsdS(sfReturn a DateTime with the value as the current object, represented in the indicated timezone.N((tz((RttoZone.scCsdS(sYReturn true if this object represents a date/time later than the time of the callN((((RtisFuture2scCsdS(s[Return true if this object represents a date/time earlier than the time of the callN((((RtisPast6scCsdS(sReturn true if this object represents a date/time that falls within the current year, in the context of this object's timezone representationN((((Rt isCurrentYear:scCsdS(sReturn true if this object represents a date/time that falls within the current month, in the context of this object's timezone representationN((((RtisCurrentMonth?scCsdS(sReturn true if this object represents a date/time that falls within the current day, in the context of this object's timezone representationN((((Rt isCurrentDayDscCsdS(sReturn true if this object represents a date/time that falls within the current hour, in the context of this object's timezone representationN((((Rt isCurrentHourIscCsdS(sReturn true if this object represents a date/time that falls within the current minute, in the context of this object's timezone representationN((((RtisCurrentMinuteNscCsdS(s`Return true if the current year (in the context of the object's timezone) is a leap yearN((((Rt isLeapYearSscCsdS(sReturn a new DateTime object that represents the earliest possible time (in whole seconds) that still falls within the current object's day, in the object's timezone contextN((((Rt earliestTimeWscCsdS(sReturn a new DateTime object that represents the latest possible time (in whole seconds) that still falls within the current object's day, in the object's timezone contextN((((Rt latestTime\scCsdS(s|Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the python time module. Returns true if the object represents a date/time greater than the specified DateTime or time module style time. Revised to give more correct results through comparison of long integer milliseconds.N((tt((Rt greaterThanascCsdS(sCompare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the python time module. Returns true if the object represents a date/time greater than or equal to the specified DateTime or time module style time. Revised to give more correct results through comparison of long integer milliseconds.N((R((RtgreaterThanEqualTokscCsdS(sxCompare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the python time module. Returns true if the object represents a date/time equal to the specified DateTime or time module style time. Revised to give more correct results through comparison of long integer milliseconds.N((R((RtequalTouscCsdS(s|Compare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the python time module. Returns true if the object represents a date/time not equal to the specified DateTime or time module style time. Revised to give more correct results through comparison of long integer milliseconds.N((R((Rt notEqualToscCsdS(syCompare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the python time module. Returns true if the object represents a date/time less than the specified DateTime or time module style time. Revised to give more correct results through comparison of long integer milliseconds.N((R((RtlessThanscCsdS(sCompare this DateTime object to another DateTime object OR a floating point number such as that which is returned by the python time module. Returns true if the object represents a date/time less than or equal to the specified DateTime or time module style time. Revised to give more correct results through comparison of long integer milliseconds.N((R((RtlessThanEqualToscCsdS(soReturn a tuple containing the calendar year, month, day, hour, minute second and timezone of the objectN((((RtpartsscCsdS(s7Return the timezone in which the object is represented.N((((RttimezonescCsdS(s4Return the timezone offset for the objects timezone.N((((RttzoffsetscCsdS(s&Return the calendar year of the objectN((((RtyearscCsdS(s,Return the month of the object as an integerN((((RtmonthscCsdS(sReturn the full month nameN((((RtMonthscCsdS(s!Return the abreviated month name.N((((RtaMonthscCsdS(sCompatibility: see aMonthN((((RtMonscCsdS(s/Return the abreviated (with period) month name.N((((RtpMonthscCsdS(sCompatibility: see pMonthN((((RtMon_scCsdS(sReturn the integer dayN((((RtdayscCsdS(s+Return the full name of the day of the weekN((((RtDayscCsdS(sCompatibility: see DayN((((Rt DayOfWeekscCsdS(s[Return the day of the year, in context of the timezone representation of the objectN((((Rt dayOfYearscCsdS(s1Return the abreviated name of the day of the weekN((((RtaDayscCsdS(sGReturn the abreviated (with period) name of the day of the weekN((((RtpDayscCsdS(sCompatibility: see pDayN((((RtDay_scCsdS(s5Return the integer day of the week, where sunday is 0N((((RtdowscCsdS(s5Return the integer day of the week, where sunday is 1N((((Rtdow_1scCsdS(s3Return the 12-hour clock representation of the hourN((((Rth_12scCsdS(s3Return the 24-hour clock representation of the hourN((((Rth_24scCsdS(s/Return the appropriate time modifier (am or pm)N((((RtampmscCsdS(s3Return the 24-hour clock representation of the hourN((((RthourscCsdS(sReturn the minuteN((((RtminutescCsdS(sReturn the secondN((((RtsecondscCsdS(s.Return the millisecond since the epoch in GMT.N((((RtmillisscCsdS(sAFormat the date/time using the *current timezone representation*.N((tformat((RtstrftimescCsdS(s&Return the date string for the object.N((((RtDatescCsdS(s;Return the time string for an object to the nearest second.N((((RtTimescCsdS(s9Return the time string for an object not showing seconds.N((((Rt TimeMinutesscCsdS(s;Return the time string for an object to the nearest second.N((((RtAMPMscCsdS(s9Return the time string for an object not showing seconds.N((((Rt AMPMMinutesscCsdS(s&Return the time string for the object.N((((Rt PreciseTimescCsdS(s&Return the time string for the object.N((((Rt PreciseAMPMscCsdS(s(Return calendar year as a 2 digit stringN((((Rtyy scCsdS(s Return month as a 2 digit stringN((((Rtmm scCsdS(sReturn day as a 2 digit stringN((((RtddscCsdS(s!Return the date in RFC 822 formatN((((Rtrfc822scCsdS(s\Return a string representing the object's value in the format: March 1, 1997 1:45 pmN((((RtfCommonscCsdS(sgReturn a string representing the object's value in the format: March 1, 1997 1:45 pm US/EasternN((((RtfCommonZscCsdS(sZReturn a string representing the object's value in the format: Mar 1, 1997 1:45 pmN((((RtaCommon scCsdS(seReturn a string representing the object's value in the format: Mar 1, 1997 1:45 pm US/EasternN((((RtaCommonZ$scCsdS(s[Return a string representing the object's value in the format: Mar. 1, 1997 1:45 pmN((((RtpCommon(scCsdS(siReturn a string representing the object's value in the format: Mar. 1, 1997 1:45 pm US/EasternN((((RtpCommonZ,scCsdS(sReturn the object in ISO standard format. Note: this is *not* ISO 8601-format! See the ISO8601 and HTML4 methods below for ISO 8601-compliant output Dates are output as: YYYY-MM-DD HH:MM:SS N((((RtISO0scCsdS(sReturn the object in ISO 8601-compatible format containing the date, time with seconds-precision and the time zone identifier - see http://www.w3.org/TR/NOTE-datetime Dates are output as: YYYY-MM-DDTHH:MM:SSTZD T is a literal character. TZD is Time Zone Designator, format +HH:MM or -HH:MM The HTML4 method below offers the same formatting, but converts to UTC before returning the value and sets the TZD"Z" N((((RtISO86018s cCsdS(s#Return the object in the format used in the HTML4.0 specification, one of the standard forms in ISO8601. See http://www.w3.org/TR/NOTE-datetime Dates are output as: YYYY-MM-DDTHH:MM:SSZ T, Z are literal characters. The time is in UTC. N((((RtHTML4EscCsdS(skReturn the Julian day according to http://www.tondering.dk/claus/cal/node3.html#sec-calcjd N((((Rt JulianDayOscCsdS(sReturn the week number according to ISO see http://www.tondering.dk/claus/cal/node6.html#SECTION00670000000000000000 N((((RtweekTscCsdS(ssA DateTime may be added to a number and a number may be added to a DateTime; two DateTimes cannot be added.N((tother((Rt__add__[scCsdS(sEither a DateTime or a number may be subtracted from a DateTime, however, a DateTime may not be subtracted from a number.N((RP((Rt__sub__ascCsdS(sKConvert a DateTime to a string that looks like a Python expression.N((((Rt__repr__fscCsdS(sConvert a DateTime to a string.N((((Rt__str__jscCsdS(sCompare a DateTime with another DateTime object, or a float such as those returned by time.time(). NOTE: __cmp__ support is provided for backward compatibility only, and mixing DateTimes with ExtensionClasses could cause __cmp__ to break. You should use the methods lessThan, greaterThan, lessThanEqualTo, greaterThanEqualTo, equalTo and notEqualTo to avoid potential problems later!!N((tobj((Rt__cmp__mscCsdS(s#Compute a hash value for a DateTimeN((((Rt__hash__wscCsdS(s=Convert to an integer number of seconds since the epoch (gmt)N((((Rt__int__zscCsdS(s=Convert to a long-int number of seconds since the epoch (gmt)N((((Rt__long__}scCsdS(sAConvert to floating-point number of seconds since the epoch (gmt)N((((Rt __float__s(WRRtNoneR R R R RRRRRRRRRRt__gt__Rt__ge__Rt__eq__Rt__ne__Rt__lt__Rt__le__RRR R!R"R#R$R%R&R'R(R)R*R+R,R-R.R/R0R1R2R3R4R5R6R7R9R:R;R<R=R>R?R@RARBRCRDRERFRGRHRIRJRKRLRMRNRORQt__radd__RRRSRTRVRWRXRYRZ(((RRs                                                                         N( t__doc__tzope.interfacet Interfacet ExceptionRRRRR(RRRRRRe((Rt?s