sciris.sc_datetime¶
Time/date utilities.
- Highlights:
tic()
/toc()
/timer()
: simple methods for timing durationsreaddate()
: convert strings to dates using common formatsdaterange()
: create a list of datesdatedelta()
: perform calculations on date strings
Functions
Convert any reasonable object -- a string, integer, or datetime object, or list/array of any of those -- to a date object. |
|
Perform calculations on a date string (or date object), returning a string (or a date). |
|
Return a list of dates from the start date to the end date. |
|
Convert a DateTime instance to decimal year. |
|
Convert a string, date/datetime object, or int to a day (int), the number of days since the start day. |
|
Convenience function to find the difference between two or more days. |
|
Accepts a datetime object or a string in ISO 8601 format and returns a human-readable string explaining when this time was. |
|
Alias for converting a date object to a formatted string. |
|
Get the current time as a datetime object, optionally in UTC time. |
|
Sleep for a nondeterminate period of time (useful for desynchronizing tasks) |
|
Convenience function for loading a date from a string. |
|
With |
|
Delay for a certain amount of time, to ensure accurate timing. |
|
With |
|
A convenience fu`ction for multiple timings. |
Classes
alias of |
|
Simple timer class. |