Inconsistent parsing in PR_ParseTimeString used by Time::FromString
Reported by
claudiom...@gmail.com,
Mar 25 2017
|
||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3050.0 Safari/537.36
Steps to reproduce the problem:
1. Compile the following code:
base::Time time_test;
base::Time::FromString("24/03/17 07:30:00 pm GMT+5:30", &time_test);
LOG(INFO) << base::TimeFormatShortDateAndTimeWithTimeZone(time_test);
base::Time::FromString("24/03/17 07:30:00 pm GMT+5:00", &time_test);
LOG(INFO) << base::TimeFormatShortDateAndTimeWithTimeZone(time_test);
base::Time::FromString("24/03/17 07:30:00 pm +0530", &time_test);
LOG(INFO) << base::TimeFormatShortDateAndTimeWithTimeZone(time_test);
What is the expected behavior?
Logs should be:
24/03/2017, 14:00:00 GMT
24/03/2017, 14:30:00 GMT
24/03/2017, 14:00:00 GMT
What went wrong?
Logs are being shown as:
24/03/2017, 14:30:00 GMT
24/03/2017, 14:30:00 GMT
24/03/2017, 14:00:00 GMT
Did this work before? No
Chrome version: 59.0.3050.0 Channel: dev
OS Version: OS X 10.12.3
Flash Version:
I have posted about it on chromium-dev (https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/kXmwHeTP3RI).
One of the replies on the thread above mentioned that "GMT+5:30" shouldn't work because it is not standardised. However, if that's the case, "GMT+5:00" shouldn't work either.
I can provide a fix for that code to be reviewed, but I would like to be first directed on what solution would be better: to either remover the this non-standardised evaluation, or to properly carry it out.
Cheers
,
Mar 28 2017
Hi miu@ - CC'ing you directly here because you're listed as the base/time/ owner. Thanks!
,
Mar 28 2017
I just would like to highlight I would love to work on this bug, however I don't want to go forward without having discussed which approach to take for this case.
,
Mar 30 2017
,
Mar 30 2018
Issue has not been modified or commented on in the last 365 days, please re-open or file a new bug if this is still an issue. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
||||
►
Sign in to add a comment |
||||
Comment 1 by ranjitkan@chromium.org
, Mar 27 2017