Class: Cakeproto::TimeWithZone

Inherits:
Protobuf::Message
  • Object
show all
Defined in:
lib/bucket_cake/proto/common.pb.rb,
lib/bucket_cake/proto/common.pb.rb,
lib/bucket_cake/proto_ext/time_with_zone.rb

Instance Method Summary collapse

Instance Method Details

#to_dateObject



12
13
14
# File 'lib/bucket_cake/proto_ext/time_with_zone.rb', line 12

def to_date
  to_local.to_date
end

#to_localObject



8
9
10
# File 'lib/bucket_cake/proto_ext/time_with_zone.rb', line 8

def to_local
  to_utc.in_time_zone(timezone_location)
end

#to_utcObject



4
5
6
# File 'lib/bucket_cake/proto_ext/time_with_zone.rb', line 4

def to_utc
  Time.at(unix_seconds).utc
end