MCPcopy Create free account
hub / github.com/git/git / dos_time

Function dos_time

archive-zip.c:613–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

611}
612
613static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time)
614{
615 time_t time;
616 struct tm tm;
617
618 if (date_overflows(*timestamp))
619 die(_("timestamp too large for this system: %"PRItime),
620 *timestamp);
621 time = (time_t)*timestamp;
622 localtime_r(&time, &tm);
623 *timestamp = time;
624
625 *dos_date = tm.tm_mday + (tm.tm_mon + 1) * 32 +
626 (tm.tm_year + 1900 - 1980) * 512;
627 *dos_time = tm.tm_sec / 2 + tm.tm_min * 32 + tm.tm_hour * 2048;
628}
629
630static int archive_zip_config(const char *var, const char *value,
631 const struct config_context *ctx UNUSED,

Callers 1

write_zip_archiveFunction · 0.85

Calls 3

date_overflowsFunction · 0.85
localtime_rFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected