Skip to main content

Date subtraction, parsing, and random timestamp generation.

Project description

Misc Date Utilities

Provides date subtraction, parsing, and random timestamp generation. Source code on GitHub.


For subtracting two dates from each other, provides class DateDifference that can store the difference between two dates, provides some overloaded functionality, and provides some static methods subtract_datetimes and subtract_datestrings to subtract datetimes and formatted date strings, respectively.


A simple parser that is used in the interpretation of date strings, provides parse_raw_date_string to get a datetime from a string formatted as "%Y-%m-%d " (note the trailing space), or as "%Y-%m-%d %H:%M".


Functionality for getting a random time within a specified range, provides generate_random_timestamp to generates a random timestamp in the range [00:00:00 - hours:minutes:seconds).


Unit tests are provided for subtract_datestrings.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for misc-date-utilities, version 1.0.7
Filename, size File type Python version Upload date Hashes
Filename, size misc_date_utilities-1.0.7-py3-none-any.whl (19.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size misc-date-utilities-1.0.7.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page