Red Hat Bugzilla – Bug 130742
strptime() %p field descriptor is likes to do nothing, should honor AM/PM time modificators
Last modified: 2007-11-30 17:10:47 EST
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):
Steps to Reproduce:
strptime is governed by the the standard which clearly says what
%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").