11#ifndef _TIME_BASE_LIB_H_
12#define _TIME_BASE_LIB_H_
23#if (defined (__GNUC__) || defined (_MSC_VER) || defined (__clang__))
24#define TIME_BUILD_YEAR (__DATE__[7] == '?' ? 1900\
25 : (((__DATE__[7] - '0') * 1000 ) \
26 + (__DATE__[8] - '0') * 100 \
27 + (__DATE__[9] - '0') * 10 \
28 + __DATE__[10] - '0'))
29#define TIME_BUILD_MONTH ( __DATE__ [2] == '?' ? 1 \
30 : __DATE__ [2] == 'n' ? ( \
31 __DATE__ [1] == 'a' ? 1 : 6) \
32 : __DATE__ [2] == 'b' ? 2 \
33 : __DATE__ [2] == 'r' ? ( \
34 __DATE__ [0] == 'M' ? 3 : 4) \
35 : __DATE__ [2] == 'y' ? 5 \
36 : __DATE__ [2] == 'l' ? 7 \
37 : __DATE__ [2] == 'g' ? 8 \
38 : __DATE__ [2] == 'p' ? 9 \
39 : __DATE__ [2] == 't' ? 10 \
40 : __DATE__ [2] == 'v' ? 11 \
42#define TIME_BUILD_DAY ( __DATE__[4] == '?' ? 1 \
43 : ((__DATE__[4] == ' ' ? 0 : \
44 ((__DATE__[4] - '0') * 10)) \
49#define EPOCH_JULIAN_DATE 2440588
52#define SEC_PER_MIN ((UINTN) 60)
53#define SEC_PER_HOUR ((UINTN) 3600)
54#define SEC_PER_DAY ((UINTN) 86400)
UINTN EFIAPI EfiTimeToEpoch(IN EFI_TIME *Time)
VOID EFIAPI EpochToEfiTime(IN UINTN EpochSeconds, OUT EFI_TIME *Time)
BOOLEAN EFIAPI IsValidTimeZone(IN INT16 TimeZone)
BOOLEAN EFIAPI IsTimeValid(IN EFI_TIME *Time)
BOOLEAN EFIAPI IsLeapYear(IN EFI_TIME *Time)
BOOLEAN EFIAPI IsDayValid(IN EFI_TIME *Time)
BOOLEAN EFIAPI IsValidDaylight(IN INT8 Daylight)
UINTN EfiTimeToWday(IN EFI_TIME *Time)