I found several bugs in strptime: 1. tm_yday is off by one with %j (tm_yday range is 0-365 while %j is 1-366). 2. string pointer is not incremented when processing %p format. 3. calling strptime(..., "%C", tm), where tm->tm_year != 0, will result in a wrong value stored in tm_year.