getdate example

  // Parameters :   // Return Values :   // --------------------------------------------------------------------------------   function privWriteFileHeader(&$p_header)
  {
    $v_result=1;

    // ----- Store the offset position of the file     $p_header['offset'] = ftell($this->zip_fd);

    // ----- Transform UNIX mtime to DOS format mdate/mtime     $v_date = getdate($p_header['mtime']);
    $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
    $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];

    // ----- Packed data     $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50,
                          $p_header['version_extracted']$p_header['flag'],
                          $p_header['compression']$v_mtime$v_mdate,
                          $p_header['crc']$p_header['compressed_size'],
                          $p_header['size'],
                          strlen($p_header['stored_filename']),
                          $p_header['extra_len']);

    

    protected function getDateParts($timestamp = null, $fast = null)
    {

        // actual timestamp         if (!is_numeric($timestamp)) {
            return getdate();
        }

        // 32bit timestamp         if (abs($timestamp) <= 0x7FFFFFFF) {
            return @getdate((int) $timestamp);
        }

        if (isset(self::$_cache)) {
            $id = strtr('Zend_DateObject_getDateParts_' . $timestamp.'_'.(int)$fast, '-','_');
            if ($result = self::$_cache->load($id)) {
                return unserialize($result);
            }
Home | Imprint | This part of the site doesn't use cookies.