Included Modules

Class Index [+]

Quicksearch

When::TM::Calendar

see gml schema

Attributes

reference_frame[R]

この暦と関連付けられた暦年代 (relation - Basis)

The calendar eras associated with the calendar being described

  type : [When::TM::CalendarEra]
time_basis[R]

一暦日の中の時間位置を定めるために、この暦とともに使用する時計 (relation - Resolution)

The clock that is used with this calendar to define temporal position within a calendar day

  type : [When::TM::Clock]

Public Instance Methods

^(jdt, options={}) click to toggle source
Alias for: jul_trans
dateTrans(cal_date, time=nil, options={}) click to toggle source
Alias for: date_trans
date_trans(cal_date, time=nil, options={}) click to toggle source

日付と時刻をユリウス日(When::TM::JulianDate)に変換する

Description of an operation for converting a date in the specified calendar to a Julian date

  cal_date : When::TM::CalDate
  time     : When::TM::ClockTime
  returns  : When::TM::JulianDate
     # File when/tmreference.rb, line 112
112:     def date_trans(cal_date, time=nil, options={})
113:       time = cal_date.clk_time if ((time == nil) && cal_date.kind_of?(DateAndTime))
114:       frac = (time) ? time.universal_time : 0.0
115:       jdn  = to_julian_date(cal_date.cal_date)
116:       return JulianDate.new((jdn - JulianDate::JD19700101) * IntervalLength::DAY + frac, options)
117:     end
Also aliased as: dateTrans
julTrans(jdt, options={}) click to toggle source
Alias for: jul_trans
jul_trans(jdt, options={}) click to toggle source

ユリウス日(When::TM::JulianDate)を日付に変換する

Description of an operation for converting a Julian date to a date in the specified calendar

  jdt     : When::TM::JulianDate
  options : {:clock, :era_name, :indeterminated_position}
  returns : When::TM::CalDate        if (options[clock] == nil)
            When::TM::CalDateAndTime if (options[clock] != nil)
     # File when/tmreference.rb, line 130
130:     def jul_trans(jdt, options={})
131:       if jdt.kind_of?(Numeric)
132:         jd_options           = options.dup
133:         jd_options[:frame]   = jd_options.delete(:clock)
134:         jd_options[:frame] ||= When.utc unless jdt.kind_of?(Integer)
135:         jdt = JulianDate.new((jdt - (JulianDate::JD19700101-0.5)) * IntervalLength::DAY, jd_options)
136:       end
137:       cal_options = jdt._attr
138:       cal_options.delete(:era_name)
139:       cal_options.update(options)
140:       cal_options[:frame] = self
141:       clock = cal_options[:clock] || jdt.clock
142:       return CalDate.new(to_cal_date(jdt.to_i), cal_options) unless clock
143:       clock = When.Clock(clock)    if clock.kind_of?(String)
144:       clock = clock._daylight(jdt) if clock && clock._need_validate
145:       frac  = clock.universal_time
146:       sdn, time = (jdt.universal_time - frac).divmod(IntervalLength::DAY)
147:       cal_options[:clock] = clock
148:       return DateAndTime.new(to_cal_date(sdn.to_i + JulianDate::JD19700101), time+frac, cal_options)
149:     end
Also aliased as: julTrans, ^
to_cal_date(jdn) click to toggle source

ユリウス日(Numeric)を日付に変換する

Description of an operation for converting a Julian date to a date in the specified calendar

  jdn     : Integer of JulianDate
  returns : [Numeric]
     # File when/tmreference.rb, line 173
173:     def to_cal_date(jdn)
174:       return _encode(_number_to_coordinates(jdn))
175:     end
to_julian_date(cal_date) click to toggle source

日付をユリウス日(Numeric)に変換する

Description of an operation for converting a date in the specified calendar to a Julian date

  cal_date : [Numeric]
  returns  : Integer of JulianDate
     # File when/tmreference.rb, line 161
161:     def to_julian_date(cal_date)
162:       return _coordinates_to_number(*_decode(cal_date))
163:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.