Mercurial > p > roundup > code
comparison roundup/date.py @ 2188:e170d3f917ad
add more doc to date.py
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 06 Apr 2004 21:56:10 +0000 |
| parents | 666402433998 |
| children | d39068bc6ef9 |
comparison
equal
deleted
inserted
replaced
| 2187:3b92a1b7a056 | 2188:e170d3f917ad |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: date.py,v 1.63 2004-03-24 04:57:25 richard Exp $ | 18 # $Id: date.py,v 1.64 2004-04-06 21:56:10 richard Exp $ |
| 19 | 19 |
| 20 """Date, time and time interval handling. | 20 """Date, time and time interval handling. |
| 21 """ | 21 """ |
| 22 __docformat__ = 'restructuredtext' | 22 __docformat__ = 'restructuredtext' |
| 23 | 23 |
| 88 <Date 2000-06-25.19:25:00> | 88 <Date 2000-06-25.19:25:00> |
| 89 | 89 |
| 90 The date format 'yyyymmddHHMMSS' (year, month, day, hour, | 90 The date format 'yyyymmddHHMMSS' (year, month, day, hour, |
| 91 minute, second) is the serialisation format returned by the serialise() | 91 minute, second) is the serialisation format returned by the serialise() |
| 92 method, and is accepted as an argument on instatiation. | 92 method, and is accepted as an argument on instatiation. |
| 93 | |
| 94 The date class handles basic arithmetic:: | |
| 95 | |
| 96 >>> d1=Date('.') | |
| 97 >>> d1 | |
| 98 <Date 2004-04-06.22:04:20.766830> | |
| 99 >>> d2=Date('2003-07-01') | |
| 100 >>> d2 | |
| 101 <Date 2003-07-01.00:00:0.000000> | |
| 102 >>> d1-d2 | |
| 103 <Interval + 280d 22:04:20> | |
| 104 >>> i1=_ | |
| 105 >>> d2+i1 | |
| 106 <Date 2004-04-06.22:04:20.000000> | |
| 107 >>> d1-i1 | |
| 108 <Date 2003-07-01.00:00:0.000000> | |
| 93 ''' | 109 ''' |
| 94 | 110 |
| 95 def __init__(self, spec='.', offset=0, add_granularity=0): | 111 def __init__(self, spec='.', offset=0, add_granularity=0): |
| 96 """Construct a date given a specification and a time zone offset. | 112 """Construct a date given a specification and a time zone offset. |
| 97 | 113 |
