You are here

function apachesolr_multilingual_zipfile::unix2DosTime in Apache Solr Multilingual 6

Same name and namespace in other branches
  1. 6.2 lib/apachesolr_multilingual_zipfile.php \apachesolr_multilingual_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_multilingual_zipfile::unix2DosTime()
apachesolr_multilingual_zipfile::addFile in lib/apachesolr_multilingual_zipfile.php
Adds "file" to archive

File

lib/apachesolr_multilingual_zipfile.php, line 74
Zip file creation class to pack Apache Solr Multilingual configuration fioles.

Class

apachesolr_multilingual_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;
}