Closed ramfjord closed 7 years ago
Hello,
thanks for engaging the conversation on this.
It behaves as expected: https://github.com/floraison/et-orbi/blob/faf733c18cc83b694c7309153a5925d0141bcce8/lib/et-orbi.rb#L296-L303
I will add a EtOrbi::EoTime#to_local_time
. What do you think?
Closing, since EtOrbi::EoTime#to_time
behaves as specified and produces the right values.
Fair enough - it does say it will be returned in UTC, shouldn't it return the correct time in UTC at least? E.G.
my_time = EtOrbi.make_time(2017, 1, 31, 12, 'Europe/Moscow')
# => 2017-01-31 12:00:00 +0300
my_time.to_time
# => 2017-01-31 09:00:00 UTC
It is the correct time:
ENV['TZ'] = 'Europe/Moscow'
t = Time.new(2017, 1, 31, 12)
p t # => 2017-01-31 12:00:00 +0300
p t.utc # => 2017-01-31 09:00:00 UTC
OK,
do not use EtOrbi::EoTime#to_time
, I will make it protected, I should not have left it public
. I will provide a to_t
that will return the result of Time.at(@seconds)
.
Thanks.
Please note that ::EtOrbi::EoTime
responds to most of the methods that ::Time
responds to.
Feel free to open an issue if a method is missing and I will add it or suggest a workaround.
Alright, thanks! Just wanted to inform you of an issue people might find. I'm happy using my workaround for now.
Should be pretty self explanatory - I believe I'm using the most recent version. Below is an illustrative snippet:
It might make sense to use the system timezone for
#to_time
, but I would have expected it to at act more like:Which incidentally is what I'm currently using as a workaround. For a bit of background, I'm using this through the Rufus::Scheduler gem.