1 #include <aros/debug.h>
4 #include <utility/date.h>
5 #include <proto/exec.h>
7 #include <proto/utility.h>
16 int retval
= RETURN_OK
;
18 dt
.dat_StrDate
= "31-dec-2000";
19 dt
.dat_Format
= FORMAT_DOS
;
26 if (strcmp(s
, "31-Dec-00")
27 || dt
.dat_Stamp
.ds_Days
!= 8400
28 || dt
.dat_Stamp
.ds_Minute
!= 0
29 || dt
.dat_Stamp
.ds_Tick
!= 0)
31 retval
= RETURN_ERROR
;
32 bug("DateToStr returned: \"%s\" days = %ld min = %ld tick = %ld\n",
34 (long)dt
.dat_Stamp
.ds_Days
,
35 (long)dt
.dat_Stamp
.ds_Minute
,
36 (long)dt
.dat_Stamp
.ds_Tick
);
39 Amiga2Date(dt
.dat_Stamp
.ds_Days
* 60 * 60 * 24 +
40 dt
.dat_Stamp
.ds_Minute
* 60 +
41 dt
.dat_Stamp
.ds_Tick
/ 50, &cd
);
51 retval
= RETURN_ERROR
;
52 bug("\nAmiga2Date says:\n\n");
53 bug("sec = %d\n", cd
.sec
);
54 bug("min = %d\n", cd
.min
);
55 bug("hour = %d\n", cd
.hour
);
56 bug("mday = %d\n", cd
.mday
);
57 bug("month = %d\n", cd
.month
);
58 bug("year = %d\n", cd
.year
);
59 bug("wday = %d\n", cd
.wday
);
62 Amiga2Date((dt
.dat_Stamp
.ds_Days
+ 1) * 60 * 60 * 24 +
63 dt
.dat_Stamp
.ds_Minute
* 60 +
64 dt
.dat_Stamp
.ds_Tick
/ 50, &cd
);
74 retval
= RETURN_ERROR
;
75 bug("\nAmiga2Date says (one day later:\n\n");
76 bug("sec = %d\n", cd
.sec
);
77 bug("min = %d\n", cd
.min
);
78 bug("hour = %d\n", cd
.hour
);
79 bug("mday = %d\n", cd
.mday
);
80 bug("month = %d\n", cd
.month
);
81 bug("year = %d\n", cd
.year
);
82 bug("wday = %d\n", cd
.wday
);
87 retval
= RETURN_ERROR
;
88 bug("Calling DateToStr failed!\n");
93 retval
= RETURN_ERROR
;
94 bug("Calling StrToDate failed!\n");