MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / time

Function time

Library/OpensslLib/SysCall/TimerWrapper.c:78–108  ·  view source on GitHub ↗

Get the system time as seconds elapsed since midnight, January 1, 1970. */ INTN time( INTN *timer )

Source from the content-addressed store, hash-verified

76// INTN *timer
77// )
78time_t time (time_t *timer)
79{
80 EFI_TIME Time;
81 UINTN Year;
82
83 //
84 // Get the current time and date information
85 //
86 gRT->GetTime (&Time, NULL);
87
88 //
89 // Years Handling
90 // UTime should now be set to 00:00:00 on Jan 1 of the current year.
91 //
92 for (Year = 1970, *timer = 0; Year != Time.Year; Year++) {
93 *timer = *timer + (time_t)(CumulativeDays[IsLeap(Year)][13] * SECSPERDAY);
94 }
95
96 //
97 // Add in number of seconds for current Month, Day, Hour, Minute, Seconds, and TimeZone adjustment
98 //
99 *timer = *timer +
100 (time_t)((Time.TimeZone != EFI_UNSPECIFIED_TIMEZONE) ? (Time.TimeZone * 60) : 0) +
101 (time_t)(CumulativeDays[IsLeap(Time.Year)][Time.Month] * SECSPERDAY) +
102 (time_t)(((Time.Day > 0) ? Time.Day - 1 : 0) * SECSPERDAY) +
103 (time_t)(Time.Hour * SECSPERHOUR) +
104 (time_t)(Time.Minute * 60) +
105 (time_t)Time.Second;
106
107 return *timer;
108}
109
110//
111// Convert a time value from type time_t to struct tm.

Callers 13

ScanSections64Function · 0.85
ScanSections32Function · 0.85
PrintMessageFunction · 0.85
layout_outputFunction · 0.85
create_debugFunction · 0.85
grub_get_datetimeFunction · 0.85
check_timeFunction · 0.85
CRYPTO_dbg_mallocFunction · 0.85
def_time_cbFunction · 0.85
OCSP_check_validityFunction · 0.85
X509_time_adj_exFunction · 0.85
RAND_pollFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected