lib/et-orbi.rb in et-orbi-1.0.2 vs lib/et-orbi.rb in et-orbi-1.0.3
- old
+ new
@@ -5,11 +5,11 @@
require 'tzinfo'
module EtOrbi
- VERSION = '1.0.2'
+ VERSION = '1.0.3'
#
# module methods
def self.now(zone=nil)
@@ -363,12 +363,14 @@
Time.utc(0) + seconds
ts =
t.strftime('%Y-%m-%d %H:%M:%S') +
".#{(seconds % 1).to_s.split('.').last}"
z =
- EtOrbi.local_tzone.period_for_local(t).abbreviation.to_s
+ EtOrbi.local_tzone ?
+ EtOrbi.local_tzone.period_for_local(t).abbreviation.to_s :
+ nil
- "(secs:#{seconds},utc~:#{ts.inspect},zo~:#{z.inspect})"
+ "(secs:#{seconds},utc~:#{ts.inspect},ltz~:#{z.inspect})"
end
def strfz(code)
return @zone.name if code == '%/Z'