Bug 130742 - strptime() %p field descriptor is likes to do nothing, should honor AM/PM time modificators
Summary: strptime() %p field descriptor is likes to do nothing, should honor AM/PM tim...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-08-24 05:32 UTC by Evgeny Sizikov
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-08-30 15:20:28 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Evgeny Sizikov 2004-08-24 05:32:06 UTC
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 15:20:28 UTC
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.