rom/exec/restoretaskstorage.c: Don't restore ETask data
[AROS.git] / compiler / clib / localtime_r.c
blob7863af94294aeb0e6b69fab2ecfcbd36d2bbf63a
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 Convert a time into a string, reentrant.
6 */
8 #include "__arosc_privdata.h"
10 /*****************************************************************************
12 NAME */
13 #include <time.h>
15 struct tm * localtime_r (
17 /* SYNOPSIS */
18 const time_t * tt,
19 struct tm * tm)
21 /* FUNCTION
22 Splits the system time in seconds into a structure.
23 The members of the tm structure are:
25 tm_sec - The number of seconds after the minute, normally in
26 the range 0 to 59, but can be up to 61 to allow for leap
27 seconds.
29 tm_min - The number of minutes after the hour, in the range 0 to 59.
31 tm_hour - The number of hours past midnight, in the range 0 to 23.
33 tm_mday - The day of the month, in the range 1 to 31.
35 tm_mon - The number of months since January, in the range 0 to 11.
37 tm_year - The number of years since 1900.
39 tm_wday - The number of days since Sunday, in the range 0 to 6.
41 tm_yday - The number of days since January 1, in the range 0 to 365.
43 tm_isdst - A flag that indicates whether daylight saving time
44 is in effect at the time described. The value is positive
45 if daylight saving time is in effect, zero if it is not,
46 and negative if the information is not available.
48 INPUTS
49 tt - A time in seconds from the 1. Jan 1970
50 tm - A struct tm to store the result in
52 RESULT
53 The pointer passed in tm.
55 NOTES
57 EXAMPLE
58 time_t tt;
59 struct tm tm;
61 // Get time
62 time (&tt);
64 // Break time up
65 localtime_r (&tt, &tm);
67 BUGS
69 SEE ALSO
70 time(), ctime_r(), asctime_r(), gmtime_r()
72 INTERNALS
74 ******************************************************************************/
76 struct aroscbase *aroscbase = __GM_GetBase();
78 time_t ti = *tt;
80 ti -= aroscbase->acb_gmtoffset * 60;
82 return gmtime_r (&ti, tm);
83 } /* localtime_r */