summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
authorMark Wiebe <mwiebe@enthought.com>2011-06-30 18:03:15 -0500
committerCharles Harris <charlesr.harris@gmail.com>2011-07-01 09:09:11 -0600
commit6cf29e5b86a9b47b1bd92799db5384bd6c35e6f0 (patch)
tree7fd11bfed8b10f5e37c4d10be5ff26b1e8fa9eb3 /doc/source
parent401d04881144684a04ac5a81fe4fbb137dc92d05 (diff)
downloadnumpy-6cf29e5b86a9b47b1bd92799db5384bd6c35e6f0.tar.gz
DOC: datetime: Updates based on Chuck's feedback
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/reference/arrays.datetime.rst22
1 files changed, 16 insertions, 6 deletions
diff --git a/doc/source/reference/arrays.datetime.rst b/doc/source/reference/arrays.datetime.rst
index ae9ef1339..835f4431e 100644
--- a/doc/source/reference/arrays.datetime.rst
+++ b/doc/source/reference/arrays.datetime.rst
@@ -18,7 +18,11 @@ Basic Datetimes
The most basic way to create datetimes is from strings in
ISO 8601 date or datetime format. The unit for internal storage
-is automatically selected from the form of the string.
+is automatically selected from the form of the string, and can
+be either a "date unit" or a "time unit". The date units are years ('Y'),
+months ('M'), weeks ('W'), and days ('D'), while the time units are
+hours ('h'), minutes ('m'), seconds ('s'), milliseconds ('ms'), and
+more SI-prefix seconds-based units.
.. admonition:: Example
@@ -164,14 +168,14 @@ a epoch of 1970-01-01T00:00Z. This means the supported dates are
always a symmetric interval around 1970.
======== ================ ======================= ==========================
- Time unit Time span Time span (years)
+ Date or Time unit Time span Time span (years)
------------------------- ----------------------- --------------------------
Code Meaning Relative Time Absolute Time
======== ================ ======================= ==========================
- Y year +- 9.2e18 years [9.2e18 BC, 9.2e18 AD]
- M month +- 7.6e17 years [7.6e17 BC, 7.6e17 AD]
- W week +- 1.7e17 years [1.7e17 BC, 1.7e17 AD]
- D day +- 2.5e16 years [2.5e16 BC, 2.5e16 AD]
+ Y year (date) +- 9.2e18 years [9.2e18 BC, 9.2e18 AD]
+ M month (date) +- 7.6e17 years [7.6e17 BC, 7.6e17 AD]
+ W week (date) +- 1.7e17 years [1.7e17 BC, 1.7e17 AD]
+ D day (date) +- 2.5e16 years [2.5e16 BC, 2.5e16 AD]
h hour +- 1.0e15 years [1.0e15 BC, 1.0e15 AD]
m minute +- 1.7e13 years [1.7e13 BC, 1.7e13 AD]
s second +- 2.9e12 years [ 2.9e9 BC, 2.9e9 AD]
@@ -216,9 +220,15 @@ The rules most typically used are 'forward' and 'backward'.
File "<stdin>", line 1, in <module>
ValueError: Non-business day date in busday_offset
+ >>> np.busday_offset('2011-06-25', 0, roll='forward')
+ numpy.datetime64('2011-06-27')
+
>>> np.busday_offset('2011-06-25', 2, roll='forward')
numpy.datetime64('2011-06-29')
+ >>> np.busday_offset('2011-06-25', 0, roll='backward')
+ numpy.datetime64('2011-06-24')
+
>>> np.busday_offset('2011-06-25', 2, roll='backward')
numpy.datetime64('2011-06-28')