2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <dos/datetime.h>
8 #include <proto/exec.h>
10 #include <proto/utility.h>
11 #include <utility/date.h>
15 struct UtilityBase
*UtilityBase
;
28 if (!(UtilityBase
= (struct UtilityBase
*)OpenLibrary("utility.library", 36)))
30 printf("Can't open utility.library!\n");
36 dt
.dat_Stamp
.ds_Days
= days
;
37 dt
.dat_Format
= FORMAT_DOS
;
42 dt
.dat_Stamp
.ds_Days
= -1;
45 //printf("date \"%s\" day = %ld\n", s, days);
47 if (dt
.dat_Stamp
.ds_Days
!= days
)
49 printf("StrToDate showed bad results for date \"%s\" (day #%ld). "
50 "StrToDate thought it was day #%ld\n", s
, (long)days
, (long)dt
.dat_Stamp
.ds_Days
);
54 Amiga2Date(seconds
, &cd
);
55 if ((secresult
= Date2Amiga(&cd
)) != seconds
)
57 printf("Date2Amiga gave wrong values for date \"%s\" (day #%ld)"
58 " (secs %ld) -> wrong secs is %ld"
59 " --> clockdate: year = %d month = %d day = %d\n"
60 , s
, (long)days
, (long)seconds
, (long)secresult
, (int)cd
.year
, (int)cd
.month
, (int)cd
.mday
);
68 } while (days
< 36525 /* 2078-01-01: same as 1978 in FORMAT_DOS */
69 && (SetSignal(0, 0) & SIGBREAKF_CTRL_C
) == 0);
71 CloseLibrary((struct Library
*)UtilityBase
);