function apachesolr_confgen_zipfile::unix2DosTime in Apache Solr Config Generator 6
Same name and namespace in other branches
- 8 lib/apachesolr_confgen_zipfile.php \apachesolr_confgen_zipfile::unix2DosTime()
- 7 lib/apachesolr_confgen_zipfile.php \apachesolr_confgen_zipfile::unix2DosTime()
Converts an Unix timestamp to a four byte DOS date and time format (date in high two bytes, time in low two bytes allowing magnitude comparison).
@access private
Parameters
integer the current Unix timestamp:
Return value
integer the current date in a four byte DOS format
1 call to apachesolr_confgen_zipfile::unix2DosTime()
- apachesolr_confgen_zipfile::addFile in lib/
apachesolr_confgen_zipfile.php - Adds "file" to archive
File
- lib/
apachesolr_confgen_zipfile.php, line 74 - Zip file creation class to pack Apache Solr configuration files
Class
- apachesolr_confgen_zipfile
- Zip file creation class. Makes zip files.
Code
function unix2DosTime($unixtime = 0) {
$timearray = $unixtime == 0 ? getdate() : getdate($unixtime);
if ($timearray['year'] < 1980) {
$timearray['year'] = 1980;
$timearray['mon'] = 1;
$timearray['mday'] = 1;
$timearray['hours'] = 0;
$timearray['minutes'] = 0;
$timearray['seconds'] = 0;
}
// end if
return $timearray['year'] - 1980 << 25 | $timearray['mon'] << 21 | $timearray['mday'] << 16 | $timearray['hours'] << 11 | $timearray['minutes'] << 5 | $timearray['seconds'] >> 1;
}