Skip to main content

Convert COARDS time specification to a datetime object.

Project description

This module converts between a given COARDS time specification and a Python datetime object, which is much more useful. Suppose you have an Array of values [1,2,3] and units “days since 1998-03-01 12:00:00”:

>>> a = [1, 2, 3]
>>> units = 'days since 1998-03-01 12:00:00'
>>> b = [parseUdunits(value, units) for value in a]
>>> print b[0].year
1998
>>> b[1] > b[0]
True
>>> print b[1] - b[0]
1 day, 0:00:00

The list ‘b’ now contains objects which can be compared and manipulated in a consistent way.

The latest version is available in a Subversion repository.

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 coards, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size coards-0.1.4.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View
Filename, size coards-0.1.4-py2.4.egg (8.4 kB) File type Egg Python version 2.4 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