2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <aros/debug.h>
9 #include <utility/date.h>
10 #include <proto/exec.h>
11 #include <proto/dos.h>
12 #include <proto/utility.h>
21 int retval
= RETURN_OK
;
23 dt
.dat_StrDate
= "31-dec-2000";
24 dt
.dat_Format
= FORMAT_DOS
;
31 if (strcmp(s
, "31-Dec-00")
32 || dt
.dat_Stamp
.ds_Days
!= 8400
33 || dt
.dat_Stamp
.ds_Minute
!= 0
34 || dt
.dat_Stamp
.ds_Tick
!= 0)
36 retval
= RETURN_ERROR
;
37 bug("DateToStr returned: \"%s\" days = %ld min = %ld tick = %ld\n",
39 (long)dt
.dat_Stamp
.ds_Days
,
40 (long)dt
.dat_Stamp
.ds_Minute
,
41 (long)dt
.dat_Stamp
.ds_Tick
);
44 Amiga2Date(dt
.dat_Stamp
.ds_Days
* 60 * 60 * 24 +
45 dt
.dat_Stamp
.ds_Minute
* 60 +
46 dt
.dat_Stamp
.ds_Tick
/ 50, &cd
);
56 retval
= RETURN_ERROR
;
57 bug("\nAmiga2Date says:\n\n");
58 bug("sec = %d\n", cd
.sec
);
59 bug("min = %d\n", cd
.min
);
60 bug("hour = %d\n", cd
.hour
);
61 bug("mday = %d\n", cd
.mday
);
62 bug("month = %d\n", cd
.month
);
63 bug("year = %d\n", cd
.year
);
64 bug("wday = %d\n", cd
.wday
);
67 Amiga2Date((dt
.dat_Stamp
.ds_Days
+ 1) * 60 * 60 * 24 +
68 dt
.dat_Stamp
.ds_Minute
* 60 +
69 dt
.dat_Stamp
.ds_Tick
/ 50, &cd
);
79 retval
= RETURN_ERROR
;
80 bug("\nAmiga2Date says (one day later:\n\n");
81 bug("sec = %d\n", cd
.sec
);
82 bug("min = %d\n", cd
.min
);
83 bug("hour = %d\n", cd
.hour
);
84 bug("mday = %d\n", cd
.mday
);
85 bug("month = %d\n", cd
.month
);
86 bug("year = %d\n", cd
.year
);
87 bug("wday = %d\n", cd
.wday
);
92 retval
= RETURN_ERROR
;
93 bug("Calling DateToStr failed!\n");
98 retval
= RETURN_ERROR
;
99 bug("Calling StrToDate failed!\n");