Bug #11755
closed
Added by xiejiangzhi@gmail.com (Jon Xie) over 8 years ago.
Updated over 8 years ago.
Description
2.2.3 :001 > Time.now
=> 2015-12-01 11:35:06 +0800
2.2.3 :002 > ENV['TZ'] = 'GMT+8'; Time.now
=> 2015-11-30 19:35:18 -0800
2.2.3 :003 > ENV['TZ'] = 'GMT-8'; Time.now
=> 2015-12-01 11:35:24 +0800
Why is this so?
- Subject changed from ENv['TZ'] timezone to ENV['TZ'] timezone
- Description updated (diff)
- Status changed from Open to Feedback
Seems correct output.
What do you expect?
Nobuyoshi Nakada wrote:
Seems correct output.
What do you expect?
I'm expect:
ENV['TZ'] = 'GMT+8'; Time.now
=> 2015-12-01 11:35:06 +0800
What reason is this excuse me?
Jon Xie wrote:
What reason is this excuse me?
Presumably you took 12 seconds between the first two commands, and then another 6 between the second and third. The clock keeps on ticking...
Matthew Kerwin wrote:
Jon Xie wrote:
What reason is this excuse me?
Presumably you took 12 seconds between the first two commands, and then another 6 between the second and third. The clock keeps on ticking...
I'm sorry, I didn't describe clearly....
I think timezone should be '+0800'
ENV['TZ'] = 'GMT+8'; Time.now
=> 2015-12-01 11:35:06 +0800
And then it was '-0800 '
ENV['TZ'] = 'GMT+8'; Time.now
=> 2015-11-30 19:35:18 -0800
- Status changed from Feedback to Third Party's Issue
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0Like0