Skip to content

Commit 166a968

Browse files
author
Richard Jones
committed
add more doc to date.py
1 parent e70c2bb commit 166a968

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

roundup/date.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
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 $
1919

2020
"""Date, time and time interval handling.
2121
"""
@@ -90,6 +90,22 @@ class Date:
9090
The date format 'yyyymmddHHMMSS' (year, month, day, hour,
9191
minute, second) is the serialisation format returned by the serialise()
9292
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>
93109
'''
94110

95111
def __init__(self, spec='.', offset=0, add_granularity=0):

0 commit comments

Comments
 (0)