Lines Matching +full:conversion +full:- +full:interval
2 * Copyright (C) 2004, 2006-2009 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
36 * struct FILETIME uses "100-nanoseconds intervals".
39 * conversion factor 10^7, it is coded this way for additional clarity.
70 i->interval = (LONGLONG)seconds * INTERVALS_PER_S in isc_interval_set()
71 + (nanoseconds + NS_INTERVAL - 1) / NS_INTERVAL; in isc_interval_set()
77 if (i->interval == 0) in isc_interval_iszero()
94 i1.LowPart = t->absolute.dwLowDateTime; in isc_time_set()
95 i1.HighPart = t->absolute.dwHighDateTime; in isc_time_set()
100 t->absolute.dwLowDateTime = i1.LowPart; in isc_time_set()
101 t->absolute.dwHighDateTime = i1.HighPart; in isc_time_set()
108 t->absolute.dwLowDateTime = 0; in isc_time_settoepoch()
109 t->absolute.dwHighDateTime = 0; in isc_time_settoepoch()
116 if (t->absolute.dwLowDateTime == 0 && in isc_time_isepoch()
117 t->absolute.dwHighDateTime == 0) in isc_time_isepoch()
127 GetSystemTimeAsFileTime(&t->absolute); in isc_time_now()
139 GetSystemTimeAsFileTime(&t->absolute); in isc_time_nowplusinterval()
141 i1.LowPart = t->absolute.dwLowDateTime; in isc_time_nowplusinterval()
142 i1.HighPart = t->absolute.dwHighDateTime; in isc_time_nowplusinterval()
144 if (UINT64_MAX - i1.QuadPart < (unsigned __int64)i->interval) in isc_time_nowplusinterval()
147 i1.QuadPart += i->interval; in isc_time_nowplusinterval()
149 t->absolute.dwLowDateTime = i1.LowPart; in isc_time_nowplusinterval()
150 t->absolute.dwHighDateTime = i1.HighPart; in isc_time_nowplusinterval()
159 return ((int)CompareFileTime(&t1->absolute, &t2->absolute)); in isc_time_compare()
169 i1.LowPart = t->absolute.dwLowDateTime; in isc_time_add()
170 i1.HighPart = t->absolute.dwHighDateTime; in isc_time_add()
172 if (UINT64_MAX - i1.QuadPart < (unsigned __int64)i->interval) in isc_time_add()
175 i1.QuadPart += i->interval; in isc_time_add()
177 result->absolute.dwLowDateTime = i1.LowPart; in isc_time_add()
178 result->absolute.dwHighDateTime = i1.HighPart; in isc_time_add()
190 i1.LowPart = t->absolute.dwLowDateTime; in isc_time_subtract()
191 i1.HighPart = t->absolute.dwHighDateTime; in isc_time_subtract()
193 if (i1.QuadPart < (unsigned __int64) i->interval) in isc_time_subtract()
196 i1.QuadPart -= i->interval; in isc_time_subtract()
198 result->absolute.dwLowDateTime = i1.LowPart; in isc_time_subtract()
199 result->absolute.dwHighDateTime = i1.HighPart; in isc_time_subtract()
211 i1.LowPart = t1->absolute.dwLowDateTime; in isc_time_microdiff()
212 i1.HighPart = t1->absolute.dwHighDateTime; in isc_time_microdiff()
213 i2.LowPart = t2->absolute.dwLowDateTime; in isc_time_microdiff()
214 i2.HighPart = t2->absolute.dwHighDateTime; in isc_time_microdiff()
222 i3 = (i1.QuadPart - i2.QuadPart) / 10; in isc_time_microdiff()
236 i1.LowPart = t->absolute.dwLowDateTime; in isc_time_seconds()
237 i1.HighPart = t->absolute.dwHighDateTime; in isc_time_seconds()
241 i3 = (i1.QuadPart - i2.QuadPart) / 10000000; in isc_time_seconds()
250 i.LowPart = t->absolute.dwLowDateTime; in isc_time_nanoseconds()
251 i.HighPart = t->absolute.dwHighDateTime; in isc_time_nanoseconds()
262 static const char badtime[] = "99-Bad-9999 99:99:99.999"; in isc_time_formattimestamp()
265 if (FileTimeToLocalFileTime(&t->absolute, &localft) && in isc_time_formattimestamp()
267 GetDateFormat(LOCALE_USER_DEFAULT, 0, &st, "dd-MMM-yyyy", in isc_time_formattimestamp()
288 if (FileTimeToSystemTime(&t->absolute, &st)) { in isc_time_formathttptimestamp()
290 "ddd',', dd-MMM-yyyy", DateBuf, 50); in isc_time_formathttptimestamp()
307 /* strtime() format: "%Y-%m-%dT%H:%M:%SZ" */ in isc_time_formatISO8601()
310 if (FileTimeToSystemTime(&t->absolute, &st)) { in isc_time_formatISO8601()
311 GetDateFormat(LOCALE_NEUTRAL, 0, &st, "yyyy-MM-dd", in isc_time_formatISO8601()