Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygentime.h
Go to the documentation of this file.
00001 #define DIFFTIME 0x19db1ded53e8000ULL 00002 #define DIFFDAYS (3 * DAYSPER100YEARS + 17 * DAYSPER4YEARS + 1 * DAYSPERYEAR) 00003 00004 #define DAYSPERYEAR 365 00005 #define DAYSPER4YEARS (4*DAYSPERYEAR+1) 00006 #define DAYSPER100YEARS (25*DAYSPER4YEARS-1) 00007 #define DAYSPER400YEARS (4*DAYSPER100YEARS+1) 00008 #define SECONDSPERDAY (24*60*60) 00009 #define SECONDSPERHOUR (60*60) 00010 #define LEAPDAY 59 00011 00012 static __inline 00013 __time64_t 00014 FileTimeToUnixTime(const FILETIME *FileTime, USHORT *millitm) 00015 { 00016 ULARGE_INTEGER ULargeInt; 00017 __time64_t time; 00018 00019 ULargeInt.LowPart = FileTime->dwLowDateTime; 00020 ULargeInt.HighPart = FileTime->dwHighDateTime; 00021 ULargeInt.QuadPart -= DIFFTIME; 00022 00023 time = ULargeInt.QuadPart / 10000000; 00024 if (millitm) 00025 *millitm = (USHORT)((ULargeInt.QuadPart % 10000000) / 10000); 00026 00027 return time; 00028 } 00029 00030 static __inline 00031 long leapyears_passed(long days) 00032 { 00033 long quadcenturies, centuries, quadyears; 00034 quadcenturies = days / DAYSPER400YEARS; 00035 days -= quadcenturies; 00036 centuries = days / DAYSPER100YEARS; 00037 days += centuries; 00038 quadyears = days / DAYSPER4YEARS; 00039 return quadyears - centuries + quadcenturies; 00040 } 00041 00042 static __inline 00043 long leapdays_passed(long days) 00044 { 00045 return leapyears_passed(days + DAYSPERYEAR - LEAPDAY + 1); 00046 } 00047 00048 static __inline 00049 long years_passed(long days) 00050 { 00051 return (days - leapdays_passed(days)) / 365; 00052 } 00053 00054 extern long dst_begin; 00055 extern long dst_end; Generated on Fri May 25 2012 04:28:22 for ReactOS by
1.7.6.1
|