dotfiles/.bin/OLD/t2i/timetest.c

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;
}