public static function unix2dos(int $timestamp = 0) : int
    {
        $timestamp = ($_timestamp == 0) ? getdate() : getdate($_timestamp);

        if ($timestamp['year'] < 1980) return (1 << 21 | 1 << 16);

        $timestamp['year'] -= 1980;

        return ($timestamp['year']    << 25 | $timestamp['mon']     << 21 |
                $timestamp['mday']    << 16 | $timestamp['hours']   << 11 |
                $timestamp['minutes'] << 5  | $timestamp['seconds'] >> 1);
    }
public static function unix2dos(int $timestamp = 0) : int
    {
        $timestamp = ($_timestamp == 0) ? getdate() : getdate($_timestamp);

        if ($timestamp['year'] < 1980) return (1 << 21 | 1 << 16);

        $timestamp['year'] -= 1980;

        return ($timestamp['year']    << 25 | $timestamp['mon']     << 21 |
                $timestamp['mday']    << 16 | $timestamp['hours']   << 11 |
                $timestamp['minutes'] << 5  | $timestamp['seconds'] >> 1);
    }
public static function unix2dos ( int $ timestamp = 0 ) : int { $ timestamp = ( $ _timestamp == 0 ) ? getdate ( ) : getdate ( $ _timestamp ) ; if ( $ timestamp [ 'year' ] < 1980 ) return ( 1 << 21 | 1 << 16 ) ; $ timestamp [ 'year' ] -= 1980 ; return ( $ timestamp [ 'year' ] << 25 | $ timestamp [ 'mon' ] << 21 | $ timestamp [ 'mday' ] << 16 | $ timestamp [ 'hours' ] << 11 | $ timestamp [ 'minutes' ] << 5 | $ timestamp [ 'seconds' ] >> 1 ) ; }
Converts a UNIX timestamp to DOS format.

$dos = Date::unix2dos($unix);

@param  int $timestamp UNIX timestamp
@return int
Converts a UNIX timestamp to DOS format .