https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251918
Bug ID: 251918 Summary: strptime(): %b always returns month 0 Product: Base System Version: 12.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: b...@freebsd.org Reporter: i...@chard.org I noticed this when using 'date -f' to convert a date string: $ date -j -f '%b %j %T %Y %Z' 'Mar 18 12:00:00 2021 GMT' Mon Jan 18 12:00:00 GMT 2021 Passing this directly to strptime() gives the same results. If I do struct tm t; strptime("Mar 18 12:00:00 2021 GMT", "%b %j %T %Y %Z", &t); then t.tm_mon is always 0. If I use an invalid month then strptime() returns NULL, so it is recognising the month names, just not actually setting the correct month number in the struct tm. Tried with a couple of locales (including 'C') with the same results. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ freebsd-bugs@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"