* [ruby-core:46058] [ruby-trunk - Bug #6683][Open] DateTime#strftime("%s") overflow on 32-bit platform
@ 2012-07-01 16:17 pixeltrix (Andrew White)
2012-07-01 20:27 ` [ruby-core:46087] [ruby-trunk - Bug #6683] " tadf (tadayoshi funaba)
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: pixeltrix (Andrew White) @ 2012-07-01 16:17 UTC (permalink / raw
To: ruby-core
Issue #6683 has been reported by pixeltrix (Andrew White).
----------------------------------------
Bug #6683: DateTime#strftime("%s") overflow on 32-bit platform
https://bugs.ruby-lang.org/issues/6683
Author: pixeltrix (Andrew White)
Status: Open
Priority: Normal
Assignee:
Category:
Target version: 1.9.3
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
The improvements to date and time in 1.9.3 introduced a regression from 1.9.2 with respect to DateTime#strftime("%s") (%s is seconds since the UNIX epoch). e.g.
# Ruby 1.9.2p320
1.9.2p320 :001 > require 'date'
1.9.2p320 :002 > require 'time'
1.9.2p320 :003 > DateTime.civil(1850).strftime('%s')
=> "-3786825600"
# Ruby 1.9.3p194
1.9.3p194 :001 > require 'date'
1.9.3p194 :002 > require 'time'
1.9.3p194 :003 > DateTime.civil(1850).strftime('%s')
=> "508141696"
The transition occurs at midnight on 23rd December 1935:
1.9.3p194 :006 > DateTime.civil(1935, 12, 23, 23, 59, 59).strftime('%s')
=> "1073790847"
1.9.3p194 :007 > DateTime.civil(1935, 12, 24, 0, 0, 0).strftime('%s')
=> "-1073692800"
Dates in the far future seem to be okay:
1.9.3p194 :013 > DateTime.civil(20000000).strftime('%s')
=> "631076872780800"
I've tried tracking it down in date_strftime.c but haven't got very far yet.
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* [ruby-core:46087] [ruby-trunk - Bug #6683] DateTime#strftime("%s") overflow on 32-bit platform
2012-07-01 16:17 [ruby-core:46058] [ruby-trunk - Bug #6683][Open] DateTime#strftime("%s") overflow on 32-bit platform pixeltrix (Andrew White)
@ 2012-07-01 20:27 ` tadf (tadayoshi funaba)
2012-07-01 20:57 ` [ruby-core:46088] [ruby-trunk - Bug #6683][Closed] " tadf (tadayoshi funaba)
2012-07-03 10:29 ` [ruby-core:46139] [ruby-trunk - Bug #6683] " naruse (Yui NARUSE)
2 siblings, 0 replies; 4+ messages in thread
From: tadf (tadayoshi funaba) @ 2012-07-01 20:27 UTC (permalink / raw
To: ruby-core
Issue #6683 has been updated by tadf (tadayoshi funaba).
Assignee set to tadf (tadayoshi funaba)
----------------------------------------
Bug #6683: DateTime#strftime("%s") overflow on 32-bit platform
https://bugs.ruby-lang.org/issues/6683#change-27694
Author: pixeltrix (Andrew White)
Status: Open
Priority: Normal
Assignee: tadf (tadayoshi funaba)
Category:
Target version: 1.9.3
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
The improvements to date and time in 1.9.3 introduced a regression from 1.9.2 with respect to DateTime#strftime("%s") (%s is seconds since the UNIX epoch). e.g.
# Ruby 1.9.2p320
1.9.2p320 :001 > require 'date'
1.9.2p320 :002 > require 'time'
1.9.2p320 :003 > DateTime.civil(1850).strftime('%s')
=> "-3786825600"
# Ruby 1.9.3p194
1.9.3p194 :001 > require 'date'
1.9.3p194 :002 > require 'time'
1.9.3p194 :003 > DateTime.civil(1850).strftime('%s')
=> "508141696"
The transition occurs at midnight on 23rd December 1935:
1.9.3p194 :006 > DateTime.civil(1935, 12, 23, 23, 59, 59).strftime('%s')
=> "1073790847"
1.9.3p194 :007 > DateTime.civil(1935, 12, 24, 0, 0, 0).strftime('%s')
=> "-1073692800"
Dates in the far future seem to be okay:
1.9.3p194 :013 > DateTime.civil(20000000).strftime('%s')
=> "631076872780800"
I've tried tracking it down in date_strftime.c but haven't got very far yet.
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* [ruby-core:46088] [ruby-trunk - Bug #6683][Closed] DateTime#strftime("%s") overflow on 32-bit platform
2012-07-01 16:17 [ruby-core:46058] [ruby-trunk - Bug #6683][Open] DateTime#strftime("%s") overflow on 32-bit platform pixeltrix (Andrew White)
2012-07-01 20:27 ` [ruby-core:46087] [ruby-trunk - Bug #6683] " tadf (tadayoshi funaba)
@ 2012-07-01 20:57 ` tadf (tadayoshi funaba)
2012-07-03 10:29 ` [ruby-core:46139] [ruby-trunk - Bug #6683] " naruse (Yui NARUSE)
2 siblings, 0 replies; 4+ messages in thread
From: tadf (tadayoshi funaba) @ 2012-07-01 20:57 UTC (permalink / raw
To: ruby-core
Issue #6683 has been updated by tadf (tadayoshi funaba).
Status changed from Open to Closed
----------------------------------------
Bug #6683: DateTime#strftime("%s") overflow on 32-bit platform
https://bugs.ruby-lang.org/issues/6683#change-27695
Author: pixeltrix (Andrew White)
Status: Closed
Priority: Normal
Assignee: tadf (tadayoshi funaba)
Category:
Target version: 1.9.3
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
The improvements to date and time in 1.9.3 introduced a regression from 1.9.2 with respect to DateTime#strftime("%s") (%s is seconds since the UNIX epoch). e.g.
# Ruby 1.9.2p320
1.9.2p320 :001 > require 'date'
1.9.2p320 :002 > require 'time'
1.9.2p320 :003 > DateTime.civil(1850).strftime('%s')
=> "-3786825600"
# Ruby 1.9.3p194
1.9.3p194 :001 > require 'date'
1.9.3p194 :002 > require 'time'
1.9.3p194 :003 > DateTime.civil(1850).strftime('%s')
=> "508141696"
The transition occurs at midnight on 23rd December 1935:
1.9.3p194 :006 > DateTime.civil(1935, 12, 23, 23, 59, 59).strftime('%s')
=> "1073790847"
1.9.3p194 :007 > DateTime.civil(1935, 12, 24, 0, 0, 0).strftime('%s')
=> "-1073692800"
Dates in the far future seem to be okay:
1.9.3p194 :013 > DateTime.civil(20000000).strftime('%s')
=> "631076872780800"
I've tried tracking it down in date_strftime.c but haven't got very far yet.
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* [ruby-core:46139] [ruby-trunk - Bug #6683] DateTime#strftime("%s") overflow on 32-bit platform
2012-07-01 16:17 [ruby-core:46058] [ruby-trunk - Bug #6683][Open] DateTime#strftime("%s") overflow on 32-bit platform pixeltrix (Andrew White)
2012-07-01 20:27 ` [ruby-core:46087] [ruby-trunk - Bug #6683] " tadf (tadayoshi funaba)
2012-07-01 20:57 ` [ruby-core:46088] [ruby-trunk - Bug #6683][Closed] " tadf (tadayoshi funaba)
@ 2012-07-03 10:29 ` naruse (Yui NARUSE)
2 siblings, 0 replies; 4+ messages in thread
From: naruse (Yui NARUSE) @ 2012-07-03 10:29 UTC (permalink / raw
To: ruby-core
Issue #6683 has been updated by naruse (Yui NARUSE).
Fixed in r36265.
----------------------------------------
Bug #6683: DateTime#strftime("%s") overflow on 32-bit platform
https://bugs.ruby-lang.org/issues/6683#change-27754
Author: pixeltrix (Andrew White)
Status: Closed
Priority: Normal
Assignee: tadf (tadayoshi funaba)
Category:
Target version: 1.9.3
ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
The improvements to date and time in 1.9.3 introduced a regression from 1.9.2 with respect to DateTime#strftime("%s") (%s is seconds since the UNIX epoch). e.g.
# Ruby 1.9.2p320
1.9.2p320 :001 > require 'date'
1.9.2p320 :002 > require 'time'
1.9.2p320 :003 > DateTime.civil(1850).strftime('%s')
=> "-3786825600"
# Ruby 1.9.3p194
1.9.3p194 :001 > require 'date'
1.9.3p194 :002 > require 'time'
1.9.3p194 :003 > DateTime.civil(1850).strftime('%s')
=> "508141696"
The transition occurs at midnight on 23rd December 1935:
1.9.3p194 :006 > DateTime.civil(1935, 12, 23, 23, 59, 59).strftime('%s')
=> "1073790847"
1.9.3p194 :007 > DateTime.civil(1935, 12, 24, 0, 0, 0).strftime('%s')
=> "-1073692800"
Dates in the far future seem to be okay:
1.9.3p194 :013 > DateTime.civil(20000000).strftime('%s')
=> "631076872780800"
I've tried tracking it down in date_strftime.c but haven't got very far yet.
--
http://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-07-03 10:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-01 16:17 [ruby-core:46058] [ruby-trunk - Bug #6683][Open] DateTime#strftime("%s") overflow on 32-bit platform pixeltrix (Andrew White)
2012-07-01 20:27 ` [ruby-core:46087] [ruby-trunk - Bug #6683] " tadf (tadayoshi funaba)
2012-07-01 20:57 ` [ruby-core:46088] [ruby-trunk - Bug #6683][Closed] " tadf (tadayoshi funaba)
2012-07-03 10:29 ` [ruby-core:46139] [ruby-trunk - Bug #6683] " naruse (Yui NARUSE)
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).