Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Date intervals

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CHANGELOG
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.markdown
Octocat-spinner-32 Rakefile
Octocat-spinner-32 timeframe.gemspec
README.markdown

timeframe

A Ruby class for describing and interacting with timeframes.

Real-world usage

Brighter Planet logo

We use timeframe for data science at Brighter Planet and in production at

Originally proposed to us by the awesome programmers at fingertips

Based on ISO 8601

As documented by wikipedia, time intervals are like:

  1. Start and end, such as 2007-03-01T13:00:00Z/2008-05-11T15:30:00Z
  2. Start and duration, such as 2007-03-01T13:00:00Z/P1Y2M10DT2H30M
  3. Duration and end, such as P1Y2M10DT2H30M/2008-05-11T15:30:00Z
  4. Duration only, such as P1Y2M10DT2H30M, with additional context information [not supported]

or more simply

<start>/<end>
<start>/<duration>
<duration>/<end>
<duration> [not supported]

Precision

Currently the end result is precise to 1 day, so these are the same:

  • 2007-03-01T00:00:00Z/2008-05-11T00:00:00Z
  • 2007-03-01/2008-05-11

This may change in the future.

Documentation

http://rdoc.info/projects/rossmeissl/timeframe

Acknowledgements

Thanks to @artemk for https://github.com/rossmeissl/timeframe/pull/5

Copyright

Copyright (c) 2012 Andy Rossmeissl, Seamus Abshere

Something went wrong with that request. Please try again.