Class: EarthTools::Result::TimeZone
- Defined in:
- lib/earth_tools/result/time_zone.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#dst ⇒ String
Whether or not the #local_time and #iso_time is currently in DST.
-
#dst? ⇒ boolean
Whether or not the #local_time and #iso_time is currently in DST.
-
#iso_time ⇒ String
The same value as #local_time but in ISO 8601 format instead See http://en.wikipedia.org/wiki/ISO_8601.
-
#local_time ⇒ String
The local time taking into account the time zone offset and any local daylight saving time in effect.
-
#suffix ⇒ String
The nautical suffix for the time zone See http://en.wikipedia.org/wiki/Nautical_time.
-
#utc_offset ⇒ Integer
The number of hours offset from UTC disregarding any correction for daylight saving time See http://en.wikipedia.org/wiki/UTC_offset.
-
#utc_time ⇒ String
The reference UTC time See http://en.wikipedia.org/wiki/Coordinated_Universal_Time.
Methods inherited from Base
#initialize, #latitude, #location, #longitude, #version
Constructor Details
This class inherits a constructor from EarthTools::Result::Base
Instance Method Details
#dst ⇒ String
Whether or not the #local_time and #iso_time is currently in DST. If they do, the value of this element will be ‘True’. If they do not, the value will be ‘False’. If it can’t be determined whether or not daylight saving time should be used, the value will be ‘Unknown’.
13 14 15 |
# File 'lib/earth_tools/result/time_zone.rb', line 13 def dst @data['dst'] end |
#dst? ⇒ boolean
Whether or not the #local_time and #iso_time is currently in DST
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/earth_tools/result/time_zone.rb', line 20 def dst? case @data['dst'] when 'True' then true when 'False' false else nil end end |
#iso_time ⇒ String
The same value as #local_time but in ISO 8601 format instead See http://en.wikipedia.org/wiki/ISO_8601.
35 36 37 |
# File 'lib/earth_tools/result/time_zone.rb', line 35 def iso_time create_time @data['isotime'] end |
#local_time ⇒ String
The local time taking into account the time zone offset and any local daylight saving time in effect
42 43 44 |
# File 'lib/earth_tools/result/time_zone.rb', line 42 def local_time iso_time end |
#suffix ⇒ String
The nautical suffix for the time zone See http://en.wikipedia.org/wiki/Nautical_time
58 59 60 |
# File 'lib/earth_tools/result/time_zone.rb', line 58 def suffix @data['suffix'] end |
#utc_offset ⇒ Integer
The number of hours offset from UTC disregarding any correction for daylight saving time See http://en.wikipedia.org/wiki/UTC_offset.
50 51 52 |
# File 'lib/earth_tools/result/time_zone.rb', line 50 def utc_offset @data['offset'].to_i end |
#utc_time ⇒ String
The reference UTC time See http://en.wikipedia.org/wiki/Coordinated_Universal_Time.
66 67 68 |
# File 'lib/earth_tools/result/time_zone.rb', line 66 def utc_time create_time @data['utctime'], "%Y-%m-%d %H:%M:%S" end |