1 #include <dos/datetime.h>
3 #include <proto/exec.h>
5 #include <proto/utility.h>
6 #include <utility/date.h>
10 struct UtilityBase
*UtilityBase
;
23 if (!(UtilityBase
= (struct UtilityBase
*)OpenLibrary("utility.library", 36)))
25 printf("Can't open utility.library!\n");
31 dt
.dat_Stamp
.ds_Days
= days
;
32 dt
.dat_Format
= FORMAT_DOS
;
37 dt
.dat_Stamp
.ds_Days
= -1;
40 //printf("date \"%s\" day = %ld\n", s, days);
42 if (dt
.dat_Stamp
.ds_Days
!= days
)
44 printf("StrToDate showed bad results for date \"%s\" (day #%ld). "
45 "StrToDate thought it was day #%ld\n", s
, (long)days
, (long)dt
.dat_Stamp
.ds_Days
);
49 Amiga2Date(seconds
, &cd
);
50 if ((secresult
= Date2Amiga(&cd
)) != seconds
)
52 printf("Date2Amiga gave wrong values for date \"%s\" (day #%ld)"
53 " (secs %ld) -> wrong secs is %ld"
54 " --> clockdate: year = %d month = %d day = %d\n"
55 , s
, (long)days
, (long)seconds
, (long)secresult
, (int)cd
.year
, (int)cd
.month
, (int)cd
.mday
);
63 } while (days
< 365 * 300); /* around 300 years */
65 CloseLibrary((struct Library
*)UtilityBase
);