protect stdAlloc and stdDealloc even more against misused MEMF_MANAGED
[AROS.git] / test / time.c
blobafdd05e1d20f9f6070549856d7256bcef9812062
1 #include <stdio.h>
2 #include <time.h>
4 int main(int argc, char **argv) {
5 time_t now, mk;
6 char buf[26], *pbuf;
7 struct tm tm;
9 now = time(NULL);
10 printf("time: %d\n", (int)now);
12 pbuf = ctime(&now);
13 printf("ctime: %s", pbuf);
14 pbuf = ctime_r(&now, &buf[0]);
15 printf("ctime_r: %s", buf);
17 mk = mktime(gmtime(&now));
18 printf("gmtime: %d\n", (int)mk);
19 mk = mktime(gmtime_r(&now, &tm));
20 printf("gmtime_r: %d\n", (int)mk);
22 mk = mktime(localtime(&now));
23 printf("localtime: %d\n", (int)mk);
24 mk = mktime(localtime_r(&now, &tm));
25 printf("localtime_r: %d\n", (int)mk);
27 pbuf = asctime(&tm);
28 printf("asctime: %s", pbuf);
29 pbuf = asctime_r(&tm, &buf[0]);
30 printf("asctime_r: %s", buf);
32 return 0;