Ticket #10906: test.c
File test.c, 325 bytes (added by , 10 years ago) |
---|
Line | |
---|---|
1 | #include <time.h> |
2 | #include <stdio.h> |
3 | |
4 | int main(void) |
5 | { |
6 | struct tm m; |
7 | const char* buffer = "Fri, 13-Dec-101 20:45:51"; |
8 | const char* format = "%a, %d-%b-%Y %H:%M:%S"; |
9 | |
10 | printf("Date is %s\n", buffer); |
11 | memset(&m, 0, sizeof(m)); |
12 | |
13 | if(strptime(buffer, format, &m) == NULL) |
14 | puts("FAILED"); |
15 | else |
16 | puts("PASSED"); |
17 | return 0; |
18 | } |