Class: DateTime
- Inherits:
-
Object
- Object
- DateTime
- Extended by:
- UnixEpoch::ClassMethods
- Includes:
- UnixEpoch::InstanceMethods
- Defined in:
- lib/unix_epoch.rb
Class Method Summary collapse
-
.from_jd(jd, fr, of = 0, sg = ITALY) ⇒ Object
Create a new DateTime object from a given JD.
Methods included from UnixEpoch::ClassMethods
Methods included from UnixEpoch::InstanceMethods
Class Method Details
.from_jd(jd, fr, of = 0, sg = ITALY) ⇒ Object
Create a new DateTime object from a given JD
sg
specifies the Day of Calendar Reform.
135 136 137 138 |
# File 'lib/unix_epoch.rb', line 135 def self.from_jd(jd, fr, of = 0, sg=ITALY) of = Rational(of, 86_400) if of != 0 and not of.kind_of? Rational new!(jd_to_ajd(jd, fr, of), of, sg) end |