method
screen_data
v1_8_6_287 -
Show latest stable
-
0 notes -
Class: XSD::XSDDateTimeImpl
- 1_8_6_287 (0)
- 1_8_7_72 (0)
- 1_8_7_330 (0)
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
screen_data(t)
public
Hide source
# File lib/xsd/datatypes.rb, line 561 def screen_data(t) # convert t to a DateTime as an internal representation. if t.respond_to?(:to_datetime) # 1.9 or later t.to_datetime elsif t.is_a?(DateTime) t elsif t.is_a?(Date) t = screen_data_str(t) t <<= 12 if t.year < 0 t elsif t.is_a?(Time) jd = DateTime.civil_to_jd(t.year, t.mon, t.mday, DateTime::ITALY) fr = DateTime.time_to_day_fraction(t.hour, t.min, [t.sec, 59].min) + t.usec.to_r / 1000000 / SecInDay of = t.utc_offset.to_r / SecInDay DateTime.new0(DateTime.jd_to_ajd(jd, fr, of), of, DateTime::ITALY) else screen_data_str(t) end end