Return a date-time variable for a given date and time.
The date and time may be specified with an ISO 8601-like date-time string (in which non-Gregorian calendar dates are allowed) or by providing a value for the year and, optionally, the month, day, hour, minute, second and microsecond.
See also
Parameters: |
|
---|---|
Returns: |
|
Examples: |
>>> d = cf.dt(2003, 2, 30)
>>> d = cf.dt(2003, 2, 30, 0, 0, 0)
>>> d = cf.dt('2003-2-30')
>>> d = cf.dt('2003-2-30 0:0:0')
>>> d = cf.dt(2003, 4, 5, 12, 30, 15)
>>> d = cf.dt(year=2003, month=4, day=5, hour=12, minute=30, second=15)
>>> d = cf.dt('2003-04-05 12:30:15')
>>> d.year, d.month, d.day, d.hour, d.minute, d.second
(2003, 4, 5, 12, 30, 15)