class LibTAD::TADTime::TADTime
Information about date, time and timezone.
Attributes
datetime[R]
@return [DateTime] Date and time, split up into components.
iso[R]
@return [String] ISO representation of date and time, time zone included (@see dev-test.timeanddate.com/docs/external-references#ISO8601 ISO8601) if different from UTC. If time is not applicable, only the date is shown.
Example: 2011-06-08T09:18:16+02:00 Example: 2011-06-08T07:18:16 (UTC time) Example: 2011-06-08 (only date)
timezone[R]
@return [TimeZone] Timezone information.
Public Class Methods
new(hash)
click to toggle source
# File lib/types/time/time.rb, line 23 def initialize(hash) @iso = hash.fetch('iso', nil) @datetime = TADDateTime.new.from_json hash['datetime'] unless !hash.key?('datetime') @timezone = TADTimeZone.new hash['timezone'] unless !hash.key?('timezone') end