This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

It Should Be Easier

The current Python landscape doesn’t make it simple enough to use timezone aware timestamps.

It’d be nice if datetime.datetime.now() gave you a timezone-aware datetime in your current timezone, but it doesn’t.

You’d expect datetime.datetime.utcnow() to at least be timezone-aware, right? No. There’s no tzinfo on the datetime you get back from that function.

The pytz package has comprehensive support for time zones, and if you need to do something complicated, you should use that. But you don’t always need to do something complicated. Sometimes you just want UTC.

This package provides syntactic sugar around simple UTC handling that I’ve rewritten in too many times in past projects.

Usage

There is a now() function that does the right thing:

>>> import utc
>>> utc.now()
datetime.datetime(2013, 8, 30, 16, 51, 50, 316963, tzinfo=<UTC>)

And a datetime constructor that is UTC by default:

>>> utc.datetime(1900, 1, 1, 13, 25)
datetime.datetime(1900, 1, 1, 13, 25, tzinfo=<UTC>)

And a time constructor too:

>>> utc.time(13, 26, 36)
datetime.time(13, 26, 36, tzinfo=<UTC>)

That is all.

Release History

Release History

0.0.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
utc-0.0.3.tar.gz (1.9 kB) Copy SHA256 Checksum SHA256 Source Feb 6, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting