* Convert the DOS date/time stamp into a UNIX time stamp. */
| 336 | * Convert the DOS date/time stamp into a UNIX time stamp. |
| 337 | */ |
| 338 | time_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. |
no outgoing calls
no test coverage detected