dotfiles/.bin/OLD/t2i/timetest.c
2024-02-14 07:55:58 +01:00

14 lines
278 B
C

#include <stdio.h>
#include <time.h>
int main(int argc, const char *argv[])
{
char str[] = "07.10.2022";
struct tm timeptr;
strptime(str, "%d.%m.%Y", &timeptr);
printf("%d%d%d\n", timeptr.tm_year + 1900, timeptr.tm_mon + 1, timeptr.tm_mday);
return 0;
}