src/Vatsimphp/Parser/DataParser.php
protected function convertTs($str)
    {
        if (empty($str) || strlen($str) != 14) {
            return false;
        }
        $y = (int) substr($str, 0, 4);
        $m = (int) substr($str, 4, 2);
        $d = (int) substr($str, 6, 2);
        $h = (int) substr($str, 8, 2);
        $i = (int) substr($str, 10, 2);
        $s = (int) substr($str, 12, 2);

        $dt = new \DateTime();
        $dt->setTimezone(new \DateTimeZone('UTC'));
        $dt->setDate($y, $m, $d);
        $dt->setTime($h, $i, $s);

        return $dt->getTimestamp();
    }
protected function convertTs($str)
    {
        if (empty($str) || strlen($str) != 14) {
            return false;
        }
        $y = (int) substr($str, 0, 4);
        $m = (int) substr($str, 4, 2);
        $d = (int) substr($str, 6, 2);
        $h = (int) substr($str, 8, 2);
        $i = (int) substr($str, 10, 2);
        $s = (int) substr($str, 12, 2);

        $dt = new \DateTime();
        $dt->setTimezone(new \DateTimeZone('UTC'));
        $dt->setDate($y, $m, $d);
        $dt->setTime($h, $i, $s);

        return $dt->getTimestamp();
    }
protected function convertTs ( $ str ) { if ( empty ( $ str ) || strlen ( $ str ) != 14 ) { return false ; } $ y = ( int ) substr ( $ str , 0 , 4 ) ; $ m = ( int ) substr ( $ str , 4 , 2 ) ; $ d = ( int ) substr ( $ str , 6 , 2 ) ; $ h = ( int ) substr ( $ str , 8 , 2 ) ; $ i = ( int ) substr ( $ str , 10 , 2 ) ; $ s = ( int ) substr ( $ str , 12 , 2 ) ; $ dt = new \ DateTime ( ) ; $ dt -> setTimezone ( new \ DateTimeZone ( 'UTC' ) ) ; $ dt -> setDate ( $ y , $ m , $ d ) ; $ dt -> setTime ( $ h , $ i , $ s ) ; return $ dt -> getTimestamp ( ) ; }
Timestamp convertor to unix time.

@param string $str

@return int
Timestamp convertor to unix time .