ReactOS 0.4.15-dev-8131-g4988de4
time.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DIFFTIME   0x19db1ded53e8000ULL
 
#define DIFFDAYS   (3 * DAYSPER100YEARS + 17 * DAYSPER4YEARS + 1 * DAYSPERYEAR)
 
#define DAYSPERYEAR   365
 
#define DAYSPER4YEARS   (4*DAYSPERYEAR+1)
 
#define DAYSPER100YEARS   (25*DAYSPER4YEARS-1)
 
#define DAYSPER400YEARS   (4*DAYSPER100YEARS+1)
 
#define SECONDSPERDAY   (24*60*60)
 
#define SECONDSPERHOUR   (60*60)
 
#define LEAPDAY   59
 

Functions

static __inline __time64_t FileTimeToUnixTime (const FILETIME *FileTime, USHORT *millitm)
 
static __inline long leapyears_passed (long days)
 
static __inline long leapdays_passed (long days)
 
static __inline long years_passed (long days)
 

Variables

long dst_begin
 
long dst_end
 

Macro Definition Documentation

◆ DAYSPER100YEARS

#define DAYSPER100YEARS   (25*DAYSPER4YEARS-1)

Definition at line 6 of file time.h.

◆ DAYSPER400YEARS

#define DAYSPER400YEARS   (4*DAYSPER100YEARS+1)

Definition at line 7 of file time.h.

◆ DAYSPER4YEARS

#define DAYSPER4YEARS   (4*DAYSPERYEAR+1)

Definition at line 5 of file time.h.

◆ DAYSPERYEAR

#define DAYSPERYEAR   365

Definition at line 4 of file time.h.

◆ DIFFDAYS

#define DIFFDAYS   (3 * DAYSPER100YEARS + 17 * DAYSPER4YEARS + 1 * DAYSPERYEAR)

Definition at line 2 of file time.h.

◆ DIFFTIME

#define DIFFTIME   0x19db1ded53e8000ULL

Definition at line 1 of file time.h.

◆ LEAPDAY

#define LEAPDAY   59

Definition at line 10 of file time.h.

◆ SECONDSPERDAY

#define SECONDSPERDAY   (24*60*60)

Definition at line 8 of file time.h.

◆ SECONDSPERHOUR

#define SECONDSPERHOUR   (60*60)

Definition at line 9 of file time.h.

Function Documentation

◆ FileTimeToUnixTime()

static __inline __time64_t FileTimeToUnixTime ( const FILETIME FileTime,
USHORT millitm 
)
static

Definition at line 14 of file time.h.

15{
16 ULARGE_INTEGER ULargeInt;
17 __time64_t time;
18
19 ULargeInt.LowPart = FileTime->dwLowDateTime;
20 ULargeInt.HighPart = FileTime->dwHighDateTime;
21 ULargeInt.QuadPart -= DIFFTIME;
22
23 time = ULargeInt.QuadPart / 10000000;
24 if (millitm)
25 *millitm = (USHORT)((ULargeInt.QuadPart % 10000000) / 10000);
26
27 return time;
28}
__u16 time
Definition: mkdosfs.c:8
unsigned short USHORT
Definition: pedump.c:61
#define DIFFTIME
Definition: time.h:1
DWORD dwHighDateTime
Definition: mapidefs.h:66
DWORD dwLowDateTime
Definition: mapidefs.h:65
$ULONG LowPart
Definition: ntbasedef.h:569
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
$ULONG HighPart
Definition: ntbasedef.h:570

Referenced by _ftime_s(), _tfindfirst(), _tfindnext(), _time(), and clock().

◆ leapdays_passed()

static __inline long leapdays_passed ( long  days)
static

Definition at line 43 of file time.h.

44{
45 return leapyears_passed(days + DAYSPERYEAR - LEAPDAY + 1);
46}
#define DAYSPERYEAR
Definition: time.h:4
#define LEAPDAY
Definition: time.h:10
static __inline long leapyears_passed(long days)
Definition: time.h:31

Referenced by _gmtime_worker(), and years_passed().

◆ leapyears_passed()

static __inline long leapyears_passed ( long  days)
static

Definition at line 31 of file time.h.

32{
33 long quadcenturies, centuries, quadyears;
34 quadcenturies = days / DAYSPER400YEARS;
35 days -= quadcenturies;
36 centuries = days / DAYSPER100YEARS;
37 days += centuries;
38 quadyears = days / DAYSPER4YEARS;
39 return quadyears - centuries + quadcenturies;
40}
#define DAYSPER100YEARS
Definition: time.h:6
#define DAYSPER400YEARS
Definition: time.h:7
#define DAYSPER4YEARS
Definition: time.h:5

Referenced by _gmtime_worker(), and leapdays_passed().

◆ years_passed()

static __inline long years_passed ( long  days)
static

Definition at line 49 of file time.h.

50{
51 return (days - leapdays_passed(days)) / 365;
52}
static __inline long leapdays_passed(long days)
Definition: time.h:43

Variable Documentation

◆ dst_begin

long dst_begin
extern

Definition at line 16 of file timezone.c.

Referenced by _gmtime_worker(), and _tzset().

◆ dst_end