MCPcopy Create free account
hub / github.com/CyanogenMod/android_frameworks_base / getModWhen

Method getModWhen

tools/aapt/ZipEntry.cpp:338–352  ·  view source on GitHub ↗

* Convert the DOS date/time stamp into a UNIX time stamp. */

Source from the content-addressed store, hash-verified

336 * Convert the DOS date/time stamp into a UNIX time stamp.
337 */
338time_t ZipEntry::getModWhen(void) const
339{
340 struct tm parts;
341
342 parts.tm_sec = (mCDE.mLastModFileTime & 0x001f) << 1;
343 parts.tm_min = (mCDE.mLastModFileTime & 0x07e0) >> 5;
344 parts.tm_hour = (mCDE.mLastModFileTime & 0xf800) >> 11;
345 parts.tm_mday = (mCDE.mLastModFileDate & 0x001f);
346 parts.tm_mon = ((mCDE.mLastModFileDate & 0x01e0) >> 5) -1;
347 parts.tm_year = ((mCDE.mLastModFileDate & 0xfe00) >> 9) + 80;
348 parts.tm_wday = parts.tm_yday = 0;
349 parts.tm_isdst = -1; // DST info "not available"
350
351 return mktime(&parts);
352}
353
354/*
355 * Set the CDE/LFH timestamp from UNIX time.

Callers 2

doListFunction · 0.80
processFileFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected