Skip to content

valodzka/time2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Small step forward

Minimalistic time zone support for Ruby time class

Ruby Time class is the one of the most disappointment parts of the ruby standard library.

The initial idea of this project was to reimplement ruby Time class with first class time zones support. But, after a couple of discussion, I realized that, dispite there are some cases when it usefull, storing timezone with time generaly brings more drawbacks than advantages. So currently library just fixes couple of ruby Time methods by adding fast cross platform implementation (Time.local, Time.utc, Time.strptime, generaly 10-100 times faster then alternatives).

FAQ

How can I use system tz database ?

At the moment library uses global variable $__tz_directory as a tz database location directory. It’s configured automaticaly to use bundled tz database in time of library loading.

Many OS (but not all) contain own tz database, so if you want to use system (or any other) tz database, you should set $__tz_directory before require 'time2' statement.

Portability

Code tested on Debian Lenny with GCC 4.3.3, Mac OS X with GCC 4.0.1 and Windows with VC 9

Acknowledgements

License

Same terms as Ruby unless otherwise specified in the file.

About

new Ruby Time implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published