Fixed compatibility of output.
[AROS.git] / test / clib / time.c
blob2726fafbbbee964499df54fe864b1504808552ed
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <stdio.h>
7 #include <time.h>
9 int main(int argc, char **argv) {
10 time_t now, mk;
11 char buf[26], *pbuf;
12 struct tm tm;
14 now = time(NULL);
15 printf("time: %d\n", (int)now);
17 pbuf = ctime(&now);
18 printf("ctime: %s", pbuf);
19 pbuf = ctime_r(&now, &buf[0]);
20 printf("ctime_r: %s", buf);
22 mk = mktime(gmtime(&now));
23 printf("gmtime: %d\n", (int)mk);
24 mk = mktime(gmtime_r(&now, &tm));
25 printf("gmtime_r: %d\n", (int)mk);
27 mk = mktime(localtime(&now));
28 printf("localtime: %d\n", (int)mk);
29 mk = mktime(localtime_r(&now, &tm));
30 printf("localtime_r: %d\n", (int)mk);
32 pbuf = asctime(&tm);
33 printf("asctime: %s", pbuf);
34 pbuf = asctime_r(&tm, &buf[0]);
35 printf("asctime_r: %s", buf);
37 return 0;