[issue22840] strpdate('20141110', '%Y%m%d%H%S') returns wrong date

Alexander Belopolsky report at bugs.python.org
Tue Nov 11 01:00:02 CET 2014


Alexander Belopolsky added the comment:

With the following C code:

#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(){

  char buf[255];
  struct tm tm;

  memset(&tm, 0, sizeof(tm));
  strptime("20141110", "%Y%m%d%H%M", &tm);
  strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M", &tm);
  printf("%s\n", buf);

  return 0;
}

I get

$ ./a.out
2014-11-10 00:00

So I think Python behavior is wrong.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22840>
_______________________________________


More information about the Python-bugs-list mailing list