Open stoecker opened 2 years ago
perl -e 'use Time::Piece; print Time::Piece->strptime("2021 47 1","%Y %W %w");' should output 2021-11-22, but outputs 2021-01-01
perl -e 'use Time::Piece; print Time::Piece->strptime("2021 47 1","%Y %W %w");'
using the same with C
#define _XOPEN_SOURCE #include <stdio.h> #include <time.h> int main(void) { struct tm t; printf("%s\n", strptime("2021 47 1", "%Y %W %w", &t)); printf("%d-%02d-%02d\n", 1900+t.tm_year, t.tm_mon+1, t.tm_mday); }
outputs 2021-11-22
It seems the _strptime in Piece.xs is improperly implemented.
perl -e 'use Time::Piece; print Time::Piece->strptime("2021 47 1","%Y %W %w");'
should output 2021-11-22, but outputs 2021-01-01using the same with C
outputs 2021-11-22
It seems the _strptime in Piece.xs is improperly implemented.