Project

General

Profile

Actions

Bug #11261

closed

Time.parse of javascript formatted timestamp: wrong results in certain timezones

Added by Envek (Andrey Novikov) over 9 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
[ruby-core:69583]

Description

If I try to parse a string generated by javascript's new Date() (seems like RFC 2822 with timezone name specified) in a browser located in Asia/Novosibirsk timezone I will get 1st of November quite frequently.

require 'time'
Time.parse('Mon May 18 2015 22:16:38 GMT+0600 (NOVT)')
# => 2015-11-01 22:16:38 +0600

Updated by akr (Akira Tanaka) over 9 years ago

It seems that Date._parse recognizes NOV as November.

% ruby -rdate -e 'p Date._parse("Mon May 18 2015 22:16:38 GMT+0600 (NOVT)")[:mon]'
11
% ruby -rdate -e 'p Date._parse("Mon May 18 2015 22:16:38 GMT+0600")[:mon]'       
5
% ruby -v                                                                  
ruby 2.3.0dev (2015-01-02 trunk 49103) [x86_64-linux]
Actions #2

Updated by jeremyevans0 (Jeremy Evans) over 5 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0