2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
5 Desc: ReadBattClock() function.
9 #include <proto/battclock.h>
10 #include <proto/utility.h>
11 #include <utility/date.h>
13 #include "battclock_intern.h"
15 AROS_LH0(ULONG
, ReadBattClock
, struct BattClockBase
*, BattClockBase
, 2, Battclock
)
21 struct ClockData date
;
23 BattClockBase
->SysIFace
->time(&t
);
27 * On UNIX time() returns local time instead of GMT.
28 * So we have all this clutter. Note that we use host function
29 * in order to convert to GMT while we could in fact use AROS one.
30 * This is because theoretically AROS and our host can be set
31 * to different time zones. Additionally we use host OS includes
32 * for definitions of struct tm and time_t.
34 tm
= BattClockBase
->SysIFace
->localtime(&t
);
37 date
.year
= tm
->tm_year
+ 1900;
38 date
.month
= tm
->tm_mon
+ 1;
39 date
.mday
= tm
->tm_mday
;
40 date
.hour
= tm
->tm_hour
;
41 date
.min
= tm
->tm_min
;
42 date
.sec
= tm
->tm_sec
;
44 return Date2Amiga(&date
);