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 = [from_udunits(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.

Source Distribution

coards-0.2.1.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

coards-0.2.1-py2.4.egg (9.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page