--- libelwix/example/test_time.c 2013/03/07 15:41:11 1.1 +++ libelwix/example/test_time.c 2013/03/07 16:24:32 1.2 @@ -0,0 +1,31 @@ +#include +#include +#include +#include + + +int +main(int argc, char **argv) +{ + time_t tim; + struct tm *tm; + char str[BUFSIZ]; + + if (argc < 2) + return 1; + + memset(str, 0, sizeof str); + + tim = time_Parse(argv[1]); + printf("time_t=%u\n", tim); + if (tim == (time_t) -1) { + ELIBERR(elwix); + return 2; + } + + tm = localtime(&tim); + strftime(str, sizeof str, "%Y-%m-%d %H:%M:%S", tm); + printf("Time:: %s\n", str); + + return 0; +}