MCPcopy Create free account
hub / github.com/NetHack/NetHack / yyyymmdd

Function yyyymmdd

src/calendar.c:55–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53
54
55long
56yyyymmdd(time_t date)
57{
58 long datenum;
59 struct tm *lt;
60
61 if (date == 0)
62 lt = getlt();
63 else
64 lt = localtime((LOCALTIME_type) &date);
65
66 /* just in case somebody's localtime supplies (year % 100)
67 rather than the expected (year - 1900) */
68 if (lt->tm_year < 70)
69 datenum = (long) lt->tm_year + 2000L;
70 else
71 datenum = (long) lt->tm_year + 1900L;
72 /* yyyy --> yyyymm */
73 datenum = datenum * 100L + (long) (lt->tm_mon + 1);
74 /* yyyymm --> yyyymmdd */
75 datenum = datenum * 100L + (long) lt->tm_mday;
76 return datenum;
77}
78
79long
80hhmmss(time_t date)

Callers 11

UseRIPMethod · 0.85
mswin_outripFunction · 0.85
calculate_rip_textFunction · 0.85
amii_outripFunction · 0.85
genl_outripFunction · 0.85
toptenFunction · 0.85
dump_fmtstrFunction · 0.85
paniclogFunction · 0.85
gnome_outripFunction · 0.85
UseRIPMethod · 0.85
Gem_outripFunction · 0.85

Calls 2

getltFunction · 0.85
localtimeFunction · 0.85

Tested by

no test coverage detected