sc_datetime#
Time/date utilities.
- Highlights:
sc.tic()/sc.toc()/sc.timer(): simple methods for timing durationssc.readdate(): convert strings to dates using common formatssc.daterange(): create a list of datessc.datedelta(): perform calculations on date strings
Classes
Functions
Get current time in seconds -- alias to time.time() |
|
Get the current time as a datetime object, optionally in UTC time. |
|
Alias for converting a date object to a formatted string. |
|
Convenience function for loading a date from a string. |
|
Convert any reasonable object -- a string, integer, or datetime object, or list/array of any of those -- to a date object (or string, pandas, or numpy date). |
|
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. |
|
Return a list of dates from the start date to the end date. |
|
Perform calculations on a date string (or date object), returning a string (or a date). |
|
Convert a date to decimal year. |
|
Convert a decimal year to a date |
|
With |
|
With |
|
A convenience fuction for multiple timings. |
|
Accepts a datetime object or a string in ISO 8601 format and returns a human-readable string explaining when this time was. |
|
Pause for the specified amount of time, taking into account how long other operations take. |
|
Sleep for a nondeterminate period of time (useful for desynchronizing tasks) |