ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:90060] [Ruby trunk Bug#15340] Time.local behaving inconsistently for excess days after 2038
       [not found] <redmine.issue-15340.20181125145322@ruby-lang.org>
@ 2018-11-25 14:53 ` dmikurube
  2018-11-25 16:14 ` [ruby-core:90061] " naruse
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: dmikurube @ 2018-11-25 14:53 UTC (permalink / raw)
  To: ruby-core

Issue #15340 has been reported by dmikurube (Dai MIKURUBE).

----------------------------------------
Bug #15340: Time.local behaving inconsistently for excess days after 2038
https://bugs.ruby-lang.org/issues/15340

* Author: dmikurube (Dai MIKURUBE)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.4.1, 2.5.1
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Time.local accepts a day of month that exceeds the largest day of the month, for example, 2018-02-31. The behavior looks inconsistent before v.s. after 2038. Are they expected behavior?

The behavior looks somewhat reasonable before 2037. The number of exceeding days is passed on the next month. 2018-02-31 exceeds for 3 days since 2018-02-28. 2018-02-31 is recognized as 2018-03-03.

But after 2038, the behavior looks strange and inconsistent compared to before 2038, as shown in the example below observed in Ruby 2.4.1 and 2.5.1.

The difference looks affecting Time.strptime as well.

~~~ ruby
irb(main):001:0> ENV['TZ']=nil
=> nil

irb(main):002:0> Time.local(2037,2,28,0,0,0,0)
=> 2037-02-28 00:00:00 +0900
irb(main):003:0> Time.local(2037,2,29,0,0,0,0)
=> 2037-03-01 00:00:00 +0900
irb(main):004:0> Time.local(2037,2,30,0,0,0,0)
=> 2037-03-02 00:00:00 +0900
irb(main):005:0> Time.local(2037,2,31,0,0,0,0)
=> 2037-03-03 00:00:00 +0900

irb(main):006:0> Time.local(2038,2,28,0,0,0,0)
=> 2038-02-28 00:00:00 +0900
irb(main):007:0> Time.local(2038,2,29,0,0,0,0)
=> 2038-03-01 00:00:00 +0900
irb(main):008:0> Time.local(2038,2,30,0,0,0,0)
=> 2038-02-28 00:00:00 +0900
irb(main):009:0> Time.local(2038,2,31,0,0,0,0)
=> 2038-03-01 00:00:00 +0900

irb(main):010:0> ENV['TZ']='UTC'
=> "UTC"

irb(main):011:0> Time.local(2037,2,28,0,0,0,0)
=> 2037-02-28 00:00:00 +0000
irb(main):012:0> Time.local(2037,2,29,0,0,0,0)
=> 2037-03-01 00:00:00 +0000
irb(main):013:0> Time.local(2037,2,30,0,0,0,0)
=> 2037-03-02 00:00:00 +0000
irb(main):014:0> Time.local(2037,2,31,0,0,0,0)
=> 2037-03-03 00:00:00 +0000

irb(main):015:0> Time.local(2038,2,28,0,0,0,0)
=> 2038-02-28 00:00:00 +0000
irb(main):016:0> Time.local(2038,2,29,0,0,0,0)
=> 2038-03-01 00:00:00 +0000
irb(main):017:0> Time.local(2038,2,30,0,0,0,0)
=> 2038-02-28 00:00:00 +0000
irb(main):018:0> Time.local(2038,2,31,0,0,0,0)
=> 2038-03-01 00:00:00 +0000
~~~

JFYI: I thought I observed a case 2038-02-30 is recognized as 2038-03-01 when ENV['TZ']=nil, but just now I couldn't reproduce the case. It might be my mistake in operations, but let me leave the log just in case. (It might be because I was in different timezones when I observed them. The example above was in JST, and the below was in PST.)

~~~ ruby
irb(main):001:0> ENV['TZ']=nil
=> nil

irb(main):002:0> Time.local(2037,2,30,0,0,0,0)
=> 2037-03-02 00:00:00 -0800
irb(main):003:0> Time.local(2038,2,30,0,0,0,0)
=> 2038-03-01 00:00:00 -0800
~~~




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:90061] [Ruby trunk Bug#15340] Time.local behaving inconsistently for excess days after 2038
       [not found] <redmine.issue-15340.20181125145322@ruby-lang.org>
  2018-11-25 14:53 ` [ruby-core:90060] [Ruby trunk Bug#15340] Time.local behaving inconsistently for excess days after 2038 dmikurube
@ 2018-11-25 16:14 ` naruse
  2019-01-16 15:33 ` [ruby-core:91126] " nagachika00
  2019-01-31 10:59 ` [ruby-core:91359] " usa
  3 siblings, 0 replies; 4+ messages in thread
From: naruse @ 2018-11-25 16:14 UTC (permalink / raw)
  To: ruby-core

Issue #15340 has been updated by naruse (Yui NARUSE).


> I thought I observed a case 2038-02-30 is recognized as 2038-03-01 when ENV['TZ']=nil, but just now I couldn't reproduce the case. It might be my mistake in operations, but let me leave the log just in case. (It might be because I was in different timezones when I observed them. The example above was in JST, and the below was in PST.)

`ENV['TZ'] = nil` means "Use system default timezone". In other words, it means `Asia/Tokyo` in Japan, and `America/Los_Angeles` in West America.

----------------------------------------
Bug #15340: Time.local behaving inconsistently for excess days after 2038
https://bugs.ruby-lang.org/issues/15340#change-75168

* Author: dmikurube (Dai MIKURUBE)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.4.1, 2.5.1
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Time.local accepts a day of month that exceeds the largest day of the month, for example, 2018-02-31. The behavior looks inconsistent before v.s. after 2038. Are they expected behavior?

The behavior looks somewhat reasonable before 2037. The number of exceeding days is passed on the next month. 2018-02-31 exceeds for 3 days since 2018-02-28. 2018-02-31 is recognized as 2018-03-03.

But after 2038, the behavior looks strange and inconsistent compared to before 2038, as shown in the example below observed in Ruby 2.4.1 and 2.5.1.

The difference looks affecting Time.strptime as well.

~~~ ruby
irb(main):001:0> ENV['TZ']=nil
=> nil

irb(main):002:0> Time.local(2037,2,28,0,0,0,0)
=> 2037-02-28 00:00:00 +0900
irb(main):003:0> Time.local(2037,2,29,0,0,0,0)
=> 2037-03-01 00:00:00 +0900
irb(main):004:0> Time.local(2037,2,30,0,0,0,0)
=> 2037-03-02 00:00:00 +0900
irb(main):005:0> Time.local(2037,2,31,0,0,0,0)
=> 2037-03-03 00:00:00 +0900

irb(main):006:0> Time.local(2038,2,28,0,0,0,0)
=> 2038-02-28 00:00:00 +0900
irb(main):007:0> Time.local(2038,2,29,0,0,0,0)
=> 2038-03-01 00:00:00 +0900
irb(main):008:0> Time.local(2038,2,30,0,0,0,0)
=> 2038-02-28 00:00:00 +0900
irb(main):009:0> Time.local(2038,2,31,0,0,0,0)
=> 2038-03-01 00:00:00 +0900

irb(main):010:0> ENV['TZ']='UTC'
=> "UTC"

irb(main):011:0> Time.local(2037,2,28,0,0,0,0)
=> 2037-02-28 00:00:00 +0000
irb(main):012:0> Time.local(2037,2,29,0,0,0,0)
=> 2037-03-01 00:00:00 +0000
irb(main):013:0> Time.local(2037,2,30,0,0,0,0)
=> 2037-03-02 00:00:00 +0000
irb(main):014:0> Time.local(2037,2,31,0,0,0,0)
=> 2037-03-03 00:00:00 +0000

irb(main):015:0> Time.local(2038,2,28,0,0,0,0)
=> 2038-02-28 00:00:00 +0000
irb(main):016:0> Time.local(2038,2,29,0,0,0,0)
=> 2038-03-01 00:00:00 +0000
irb(main):017:0> Time.local(2038,2,30,0,0,0,0)
=> 2038-02-28 00:00:00 +0000
irb(main):018:0> Time.local(2038,2,31,0,0,0,0)
=> 2038-03-01 00:00:00 +0000
~~~

JFYI: I thought I observed a case 2038-02-30 is recognized as 2038-03-01 when ENV['TZ']=nil, but just now I couldn't reproduce the case. It might be my mistake in operations, but let me leave the log just in case. (It might be because I was in different timezones when I observed them. The example above was in JST, and the below was in PST.)

~~~ ruby
irb(main):001:0> ENV['TZ']=nil
=> nil

irb(main):002:0> Time.local(2037,2,30,0,0,0,0)
=> 2037-03-02 00:00:00 -0800
irb(main):003:0> Time.local(2038,2,30,0,0,0,0)
=> 2038-03-01 00:00:00 -0800
~~~




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:91126] [Ruby trunk Bug#15340] Time.local behaving inconsistently for excess days after 2038
       [not found] <redmine.issue-15340.20181125145322@ruby-lang.org>
  2018-11-25 14:53 ` [ruby-core:90060] [Ruby trunk Bug#15340] Time.local behaving inconsistently for excess days after 2038 dmikurube
  2018-11-25 16:14 ` [ruby-core:90061] " naruse
@ 2019-01-16 15:33 ` nagachika00
  2019-01-31 10:59 ` [ruby-core:91359] " usa
  3 siblings, 0 replies; 4+ messages in thread
From: nagachika00 @ 2019-01-16 15:33 UTC (permalink / raw)
  To: ruby-core

Issue #15340 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.3: WONTFIX, 2.4: REQUIRED, 2.5: REQUIRED to 2.3: WONTFIX, 2.4: REQUIRED, 2.5: DONE

ruby_2_5 r66839 merged revision(s) 65974.

----------------------------------------
Bug #15340: Time.local behaving inconsistently for excess days after 2038
https://bugs.ruby-lang.org/issues/15340#change-76359

* Author: dmikurube (Dai MIKURUBE)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.4.1, 2.5.1
* Backport: 2.3: WONTFIX, 2.4: REQUIRED, 2.5: DONE
----------------------------------------
Time.local accepts a day of month that exceeds the largest day of the month, for example, 2018-02-31. The behavior looks inconsistent before v.s. after 2038. Are they expected behavior?

The behavior looks somewhat reasonable before 2037. The number of exceeding days is passed on the next month. 2018-02-31 exceeds for 3 days since 2018-02-28. 2018-02-31 is recognized as 2018-03-03.

But after 2038, the behavior looks strange and inconsistent compared to before 2038, as shown in the example below observed in Ruby 2.4.1 and 2.5.1.

The difference looks affecting Time.strptime as well.

~~~ ruby
irb(main):001:0> ENV['TZ']=nil
=> nil

irb(main):002:0> Time.local(2037,2,28,0,0,0,0)
=> 2037-02-28 00:00:00 +0900
irb(main):003:0> Time.local(2037,2,29,0,0,0,0)
=> 2037-03-01 00:00:00 +0900
irb(main):004:0> Time.local(2037,2,30,0,0,0,0)
=> 2037-03-02 00:00:00 +0900
irb(main):005:0> Time.local(2037,2,31,0,0,0,0)
=> 2037-03-03 00:00:00 +0900

irb(main):006:0> Time.local(2038,2,28,0,0,0,0)
=> 2038-02-28 00:00:00 +0900
irb(main):007:0> Time.local(2038,2,29,0,0,0,0)
=> 2038-03-01 00:00:00 +0900
irb(main):008:0> Time.local(2038,2,30,0,0,0,0)
=> 2038-02-28 00:00:00 +0900
irb(main):009:0> Time.local(2038,2,31,0,0,0,0)
=> 2038-03-01 00:00:00 +0900

irb(main):010:0> ENV['TZ']='UTC'
=> "UTC"

irb(main):011:0> Time.local(2037,2,28,0,0,0,0)
=> 2037-02-28 00:00:00 +0000
irb(main):012:0> Time.local(2037,2,29,0,0,0,0)
=> 2037-03-01 00:00:00 +0000
irb(main):013:0> Time.local(2037,2,30,0,0,0,0)
=> 2037-03-02 00:00:00 +0000
irb(main):014:0> Time.local(2037,2,31,0,0,0,0)
=> 2037-03-03 00:00:00 +0000

irb(main):015:0> Time.local(2038,2,28,0,0,0,0)
=> 2038-02-28 00:00:00 +0000
irb(main):016:0> Time.local(2038,2,29,0,0,0,0)
=> 2038-03-01 00:00:00 +0000
irb(main):017:0> Time.local(2038,2,30,0,0,0,0)
=> 2038-02-28 00:00:00 +0000
irb(main):018:0> Time.local(2038,2,31,0,0,0,0)
=> 2038-03-01 00:00:00 +0000
~~~

JFYI: I thought I observed a case 2038-02-30 is recognized as 2038-03-01 when ENV['TZ']=nil, but just now I couldn't reproduce the case. It might be my mistake in operations, but let me leave the log just in case. (It might be because I was in different timezones when I observed them. The example above was in JST, and the below was in PST.)

~~~ ruby
irb(main):001:0> ENV['TZ']=nil
=> nil

irb(main):002:0> Time.local(2037,2,30,0,0,0,0)
=> 2037-03-02 00:00:00 -0800
irb(main):003:0> Time.local(2038,2,30,0,0,0,0)
=> 2038-03-01 00:00:00 -0800
~~~




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:91359] [Ruby trunk Bug#15340] Time.local behaving inconsistently for excess days after 2038
       [not found] <redmine.issue-15340.20181125145322@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2019-01-16 15:33 ` [ruby-core:91126] " nagachika00
@ 2019-01-31 10:59 ` usa
  3 siblings, 0 replies; 4+ messages in thread
From: usa @ 2019-01-31 10:59 UTC (permalink / raw)
  To: ruby-core

Issue #15340 has been updated by usa (Usaku NAKAMURA).

Backport changed from 2.3: WONTFIX, 2.4: REQUIRED, 2.5: DONE to 2.3: WONTFIX, 2.4: DONE, 2.5: DONE

ruby_2_4 r66967 merged revision(s) 65974.

----------------------------------------
Bug #15340: Time.local behaving inconsistently for excess days after 2038
https://bugs.ruby-lang.org/issues/15340#change-76612

* Author: dmikurube (Dai MIKURUBE)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.4.1, 2.5.1
* Backport: 2.3: WONTFIX, 2.4: DONE, 2.5: DONE
----------------------------------------
Time.local accepts a day of month that exceeds the largest day of the month, for example, 2018-02-31. The behavior looks inconsistent before v.s. after 2038. Are they expected behavior?

The behavior looks somewhat reasonable before 2037. The number of exceeding days is passed on the next month. 2018-02-31 exceeds for 3 days since 2018-02-28. 2018-02-31 is recognized as 2018-03-03.

But after 2038, the behavior looks strange and inconsistent compared to before 2038, as shown in the example below observed in Ruby 2.4.1 and 2.5.1.

The difference looks affecting Time.strptime as well.

~~~ ruby
irb(main):001:0> ENV['TZ']=nil
=> nil

irb(main):002:0> Time.local(2037,2,28,0,0,0,0)
=> 2037-02-28 00:00:00 +0900
irb(main):003:0> Time.local(2037,2,29,0,0,0,0)
=> 2037-03-01 00:00:00 +0900
irb(main):004:0> Time.local(2037,2,30,0,0,0,0)
=> 2037-03-02 00:00:00 +0900
irb(main):005:0> Time.local(2037,2,31,0,0,0,0)
=> 2037-03-03 00:00:00 +0900

irb(main):006:0> Time.local(2038,2,28,0,0,0,0)
=> 2038-02-28 00:00:00 +0900
irb(main):007:0> Time.local(2038,2,29,0,0,0,0)
=> 2038-03-01 00:00:00 +0900
irb(main):008:0> Time.local(2038,2,30,0,0,0,0)
=> 2038-02-28 00:00:00 +0900
irb(main):009:0> Time.local(2038,2,31,0,0,0,0)
=> 2038-03-01 00:00:00 +0900

irb(main):010:0> ENV['TZ']='UTC'
=> "UTC"

irb(main):011:0> Time.local(2037,2,28,0,0,0,0)
=> 2037-02-28 00:00:00 +0000
irb(main):012:0> Time.local(2037,2,29,0,0,0,0)
=> 2037-03-01 00:00:00 +0000
irb(main):013:0> Time.local(2037,2,30,0,0,0,0)
=> 2037-03-02 00:00:00 +0000
irb(main):014:0> Time.local(2037,2,31,0,0,0,0)
=> 2037-03-03 00:00:00 +0000

irb(main):015:0> Time.local(2038,2,28,0,0,0,0)
=> 2038-02-28 00:00:00 +0000
irb(main):016:0> Time.local(2038,2,29,0,0,0,0)
=> 2038-03-01 00:00:00 +0000
irb(main):017:0> Time.local(2038,2,30,0,0,0,0)
=> 2038-02-28 00:00:00 +0000
irb(main):018:0> Time.local(2038,2,31,0,0,0,0)
=> 2038-03-01 00:00:00 +0000
~~~

JFYI: I thought I observed a case 2038-02-30 is recognized as 2038-03-01 when ENV['TZ']=nil, but just now I couldn't reproduce the case. It might be my mistake in operations, but let me leave the log just in case. (It might be because I was in different timezones when I observed them. The example above was in JST, and the below was in PST.)

~~~ ruby
irb(main):001:0> ENV['TZ']=nil
=> nil

irb(main):002:0> Time.local(2037,2,30,0,0,0,0)
=> 2037-03-02 00:00:00 -0800
irb(main):003:0> Time.local(2038,2,30,0,0,0,0)
=> 2038-03-01 00:00:00 -0800
~~~




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-31 11:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15340.20181125145322@ruby-lang.org>
2018-11-25 14:53 ` [ruby-core:90060] [Ruby trunk Bug#15340] Time.local behaving inconsistently for excess days after 2038 dmikurube
2018-11-25 16:14 ` [ruby-core:90061] " naruse
2019-01-16 15:33 ` [ruby-core:91126] " nagachika00
2019-01-31 10:59 ` [ruby-core:91359] " usa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).