Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 126 lines (88 sloc) 3.777 kB
8f0ff47 cleanup
Stefan Rusterholz authored
1 = Chronos
2
9efd6e6 @apeiros updated
authored
3
4
1727157 @apeiros Added NOTES which explains some troubles around math with date/time/d…
authored
5 == INDEXING
ec821fe gtd
Stefan Rusterholz authored
6 Name:: Chronos
7 Gem:: chronos
8 Summary:: Library to deal with Date, Time, Durations and Intervals.
8f0ff47 cleanup
Stefan Rusterholz authored
9 Author:: Stefan Rusterholz <stefan.rusterholz+chronos at gmail.com>
9efd6e6 @apeiros updated
authored
10 Version:: 0.1.1
8f0ff47 cleanup
Stefan Rusterholz authored
11 Website:: http://chronos.rubyforge.org/
12 Git Repository:: http://github.com/apeiros/chronos
9efd6e6 @apeiros updated
authored
13 Bugtracker:: http://rubyforge.org/tracker/?atid=25774&group_id=6649&func=browse
14 Feature Requests:: http://rubyforge.org/tracker/?atid=25777&group_id=6649&func=browse
8f0ff47 cleanup
Stefan Rusterholz authored
15 License:: Ruby License (see LICENSE.txt)
16
9efd6e6 @apeiros updated
authored
17
18
19 == SUMMARY
20 Chronos is a library that lets you easily deal with various kinds of calculations
8f0ff47 cleanup
Stefan Rusterholz authored
21 with dates, times, durations and intervals.
22
9efd6e6 @apeiros updated
authored
23
24
25 == DESCRIPTION
26 (none yet)
27
28
29
1727157 @apeiros Added NOTES which explains some troubles around math with date/time/d…
authored
30 == IMPORTANT
31 Date, Time and Duration don't satisfy usual algebraic laws. Many operations are a
32 matter of definition. It is very likely that your expectation might be broken at
33 some points. Read the NOTES.rdoc for ambiguous cases and how they are solved in
34 Chronos.
8f0ff47 cleanup
Stefan Rusterholz authored
35
9efd6e6 @apeiros updated
authored
36
37
1727157 @apeiros Added NOTES which explains some troubles around math with date/time/d…
authored
38 == INSTALLING
8f0ff47 cleanup
Stefan Rusterholz authored
39 === Via RubyGems
40 You need for the installation:
41 * rubygems >= 1.2.0
42
43 You need for some of the rake tasks:
44 * bacon
45 * flexmock
46 * git
47 * hpricot
48 * rcov
49 * rdiscount (or markdown)
50 * rdoc
51 * rspec
52
53 To install, do:
54
55 gem install chronos
56
57 Note: you might have to use 'sudo gem install chronos'
58
59 === From Github
60 You need for the installation:
61 * rubygems >= 1.2.0
62
63 You need for some of the rake tasks:
64 * bacon
65 * flexmock
66 * git
67 * hpricot
68 * rcov
69 * rdiscount (or markdown)
70 * rdoc
71 * rspec
72
73 To install, do:
74
75 curl -L -o chronos.tgz http://github.com/apeiros/chronos/tarball/master
76 tar -xfz chronos.tgz
daabe4e @apeiros Further fixes for displaying on github
authored
77 cd apeiros-chronos-<big number here>/
8f0ff47 cleanup
Stefan Rusterholz authored
78 rake gem:install
79
80 Note: you might have to use 'sudo rake gem:install'
81
82
9efd6e6 @apeiros updated
authored
83
54a7991 @apeiros Added info to DESIGN part in README
authored
84 == EXAMPLES
9efd6e6 @apeiros updated
authored
85 See in the examples directory for code examples.
86
8f0ff47 cleanup
Stefan Rusterholz authored
87
88
54a7991 @apeiros Added info to DESIGN part in README
authored
89 == DESIGN
90 === General
91 In general for all structures there are calendary-agnostic classes. Those are directly
92 defined within the Chronos module. The calendary specific subclasses are then defined
88faa1b @apeiros Fix display on github
authored
93 as ::Chronos::+Classname+::+Calendarname+. There are shortcuts defined via specific requires.
94 E.g. if you require 'chronos/+calendarname+' it will map all
95 ::Chronos::+Classname+::+Calendarname+ to ::+Classname+ for convenience.
54a7991 @apeiros Added info to DESIGN part in README
authored
96
97 === Datetime
98 A datetime is a point on the axis of time. This axis has an origin (zero point). For chronos this
99 origin is defined to be backdated gregorian datetime 0000-01-01T00:00:00Z. The units to measure
100 the distance from this origin is days+picoseconds, where 8.64e16 picoseconds is 1 day.
101 The calendar specific classes then can represent that date/time in the units defined for that
102 calendar, such as gregorian can represent that distance from origin as
cb00900 @apeiros more details
authored
103 year-month-day"T"hour:minute:second.fraction±offset.
54a7991 @apeiros Added info to DESIGN part in README
authored
104 Timezone and DST are only representational offsets on top of that distance. That means that
105 2008-01-01T12:00Z and 2008-01-01T14:00+02:00 have the same distance, but are represented
106 differently due to the different offset. Just as "May" (english) and "Mai" (german) are
107 different representations of the same month.
cb00900 @apeiros more details
authored
108 So Datetime and all its subclasses store date and time without representational offsets, those
109 are only respected when accessing calendary-specific values, such as month, day, hour etc.
54a7991 @apeiros Added info to DESIGN part in README
authored
110
9efd6e6 @apeiros updated
authored
111
112
113 == CREDITS
114 Yukihiro "Matz" Matsumoto:: For ruby
115 Jarrett C.:: Helping with the C implementation
116 Various People:: For rubygems, rake, all the support in #ruby-lang, #ruby-pro and the ruby-talk ML
117
118
119
54a7991 @apeiros Added info to DESIGN part in README
authored
120 == LINKS
9efd6e6 @apeiros updated
authored
121 Website:: http://chronos.rubyforge.org/
122 Git Repository:: http://github.com/apeiros/chronos
123 Report a bug:: http://rubyforge.org/tracker/?func=add&group_id=6649&atid=25774
124 Request a feature:: http://rubyforge.org/tracker/?func=add&group_id=6649&atid=25777
125 ISO 8601:: http://en.wikipedia.org/wiki/ISO_8601
Something went wrong with that request. Please try again.