Ruby/Date/julian

Материал из Wiki.crossplatform.ru

(Различия между версиями)
Перейти к: навигация, поиск
м (1 версия: Импорт выборки материалов по Ruby)
 

Текущая версия на 18:00, 13 сентября 2010

create a year based on the Julian day with the jd class method

require "date"
nd = Date.jd( 2454048 )
puts nd.to_s



get the Julian day (days from January 1, .C., starting from 0) with the jd instance method

require "date"
date.jd # => 2454048



To see the difference between Julian and Gregorian dates (there is a difference of more than 10 days), find the Julian day with the julian method

require "date"
puts date.julian.to_s