MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / calctzdiff

Function calctzdiff

dep/hfsutils/libhfs/data.c:432–461  ·  view source on GitHub ↗

* NAME: calctzdiff() * DESCRIPTION: calculate the timezone difference between local time and UTC */

Source from the content-addressed store, hash-verified

430 * DESCRIPTION: calculate the timezone difference between local time and UTC
431 */
432static
433void calctzdiff(void)
434{
435# ifdef HAVE_MKTIME
436
437 time_t t;
438 int isdst;
439 struct tm tm;
440 const struct tm *tmp;
441
442 time(&t);
443 isdst = localtime(&t)->tm_isdst;
444
445 tmp = gmtime(&t);
446 if (tmp)
447 {
448 tm = *tmp;
449 tm.tm_isdst = isdst;
450
451 tzdiff = t - mktime(&tm);
452 }
453 else
454 tzdiff = 0;
455
456# else
457
458 tzdiff = 0;
459
460# endif
461}
462
463/*
464 * NAME: data->ltime()

Callers 2

d_ltimeFunction · 0.85
d_mtimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected