src/ConvertibleTimestamp.php
public function getTimestamp( $style = TS_UNIX ) {
		if ( !isset( self::$formats[$style] ) ) {
			throw new TimestampException( __METHOD__ . ': Illegal timestamp output type.' );
		}

		$output = $this->timestamp->format( self::$formats[$style] );

		if ( $style == TS_RFC2822 ) {
			$output .= ' GMT';
		}

		if ( $style == TS_MW && strlen( $output ) !== 14 ) {
			throw new TimestampException( __METHOD__ . ': The timestamp cannot be represented in ' .
				'the specified format' );
		}

		return $output;
	}
public function getTimestamp( $style = TS_UNIX ) {
		if ( !isset( self::$formats[$style] ) ) {
			throw new TimestampException( __METHOD__ . ': Illegal timestamp output type.' );
		}

		$output = $this->timestamp->format( self::$formats[$style] );

		if ( $style == TS_RFC2822 ) {
			$output .= ' GMT';
		}

		if ( $style == TS_MW && strlen( $output ) !== 14 ) {
			throw new TimestampException( __METHOD__ . ': The timestamp cannot be represented in ' .
				'the specified format' );
		}

		return $output;
	}
public function getTimestamp ( $ style = TS_UNIX ) { if ( ! isset ( self :: $ formats [ $ style ] ) ) { throw new TimestampException ( __METHOD__ . ': Illegal timestamp output type.' ) ; } $ output = $ this -> timestamp -> format ( self :: $ formats [ $ style ] ) ; if ( $ style == TS_RFC2822 ) { $ output .= ' GMT' ; } if ( $ style == TS_MW && strlen ( $ output ) !== 14 ) { throw new TimestampException ( __METHOD__ . ': The timestamp cannot be represented in ' . 'the specified format' ) ; } return $ output ; }
Get the timestamp represented by this object in a certain form.

Convert the internal timestamp to the specified format and then
return it.

@param int $style Constant Output format for timestamp
@throws TimestampException
@return string The formatted timestamp
Get the timestamp represented by this object in a certain form .