MCPcopy Index your code
hub / github.com/NetHack/NetHack / localtime

Function localtime

outdated/sys/wince/celib.c:28–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26static char _day_mo[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
27
28struct tm *__cdecl localtime(const time_t *ptime)
29{
30 static struct tm ptm;
31 int i;
32 if (!ptime)
33 return NULL;
34
35 _t_cnv.t_val = *ptime;
36
37 ptm.tm_sec = _t_cnv.tm_val.ss; /* seconds after the minute - [0,59] */
38 ptm.tm_min = _t_cnv.tm_val.mm; /* minutes after the hour - [0,59] */
39 ptm.tm_hour = _t_cnv.tm_val.hh; /* hours since midnight - [0,23] */
40 ptm.tm_mday = _t_cnv.tm_val.dd; /* day of the month - [1,31] */
41 ptm.tm_mon = _t_cnv.tm_val.mo - 1; /* months since January - [0,11] */
42 ptm.tm_year = _t_cnv.tm_val.yr; /* years since 1900 */
43 ptm.tm_wday = _t_cnv.tm_val.wd; /* days since Sunday - [0,6] */
44
45 ptm.tm_yday = _t_cnv.tm_val.dd; /* days since January 1 - [0,365] */
46 for (i = 0; i < ptm.tm_mon; i++)
47 ptm.tm_yday +=
48 IS_LEAP(_t_cnv.tm_val.yr + 1900) ? _day_mo_leap[i] : _day_mo[i];
49
50 ptm.tm_isdst = 0; /* daylight savings time flag - NOT IMPLEMENTED */
51 return &ptm;
52}
53
54time_t __cdecl time(time_t *timeptr)
55{

Callers 7

mainFunction · 0.85
getltFunction · 0.85
yyyymmddFunction · 0.85
hhmmssFunction · 0.85
yyyymmddhhmmssFunction · 0.85
do_dateFunction · 0.85
get_preambleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected