Bug 130742 - strptime() %p field descriptor is likes to do nothing, should honor AM/PM time modificators
strptime() %p field descriptor is likes to do nothing, should honor AM/PM tim...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-08-24 01:32 EDT by Evgeny Sizikov
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-30 11:20:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Evgeny Sizikov 2004-08-24 01:32:06 EDT
Description of problem:
This is a peace of C code: 
...
struct tm time;
strptime("10:22PM", "%R%p", &time);
...
Shouldn't we got 22:22:00 in 24-hour notation? Right now I've got
10:22:00 even if use setlocale(LC_TIME, "en_US");  before above fragment.

Version-Release number of selected component (if applicable):
glibc-2.3.3-27, gcc-3.3.3-7

How reproducible:
always

Steps to Reproduce:
1.
2.
3.
  
Actual results:
10:22:00

Expected results:
22:22:00

Additional info:
Comment 1 Jakub Jelinek 2004-08-30 11:20:28 EDT
No.
strptime is governed by the the standard which clearly says what
should happen.
%R is %H:%M and %H is 24 hour notation.  If you want to get 22:22:00
in struct tm passed to strptime, use "%I:%M%p" format instead of
"%R%p" (which is the same as "%H:%M%p").

Note You need to log in before you can comment on or make changes to this bug.