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

Here are some methods for formatting and parsing friendly timestamps.

Installation

easy_install -U whenIO

Usage

>>> import whenIO
>>> import datetime
>>> w = whenIO.WhenIO(timezone='US/Eastern')

>>> w.format(datetime.datetime.now(), fromUTC=False)
'Today 2:30pm'
>>> w.format(datetime.datetime.utcnow())
'Today 2:30pm'
>>> w.format(datetime.datetime.utcnow(), forceDate=True)
'Today 3/10/2013 2:30pm'
>>> date1 = datetime.datetime(2000, 1, 1, 0, 0)
>>> date2 = datetime.datetime(2000, 1, 1, 1, 0)
>>> w.format([date1, date2], fromUTC=False)
'1/1/2000 12am 1am'

>>> w.parse('10am', toUTC=False)[0]
[datetime.datetime(2013, 3, 10, 10, 0)]
>>> w.parse('today 10am', toUTC=False)[0]
[datetime.datetime(2013, 3, 10, 10, 0)]
>>> w.parse('tom 8pm', toUTC=False)[0]
[datetime.datetime(2013, 3, 11, 20, 0)]
>>> w.parse('mon 10am 12pm', toUTC=False)[0]
[datetime.datetime(2013, 3, 11, 10, 0),
 datetime.datetime(2013, 3, 11, 12, 0)]

>>> rdelta = whenIO.parse_duration('111 weeks')
>>> whenIO.format_duration(rdelta)
'2 years 3 months 3 weeks'
>>> whenIO.format_duration(rdelta, precision=2, style='abbreviations')
'2 yrs 4 mos'

1.5

  • Added unit abbreviations and letters to parse_duration(), format_duration()
  • Added control over rounding behavior to format_duration()

1.4

  • Added forceDate to format(), format_date()
  • Replaced withStartDate to omitStartDate

1.3

  • Changed constructor to use timezones from pytz and tzlocal
  • Added weeks to format_duration()
  • Added withLeadingZero to format(), format_date(), format_time()
  • Added withStartDate to format()
  • Removed parse_offset(), format_offset()

1.2

  • Removed python-dateutil==1.5 requirement
  • Restored test coverage to 100%

1.1

  • Added format_duration() for formatting relativedelta objects
  • Added parse_duration() for parsing text into relativedelta objects

1.0

  • Expanded test coverage to 100%
Release History

Release History

1.5.1

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

1.5

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

1.4

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

1.3

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

1.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

1.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

1.0

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
whenIO-1.5.1.tar.gz (6.5 kB) Copy SHA256 Checksum SHA256 Source Nov 28, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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