TS_RFC2822 => 'D, d M Y H:i:s',
TS_ORACLE => 'd-m-Y H:i:s.000000', // Was 'd-M-y h.i.s A' . ' +00:00' before r51500
TS_POSTGRES => 'Y-m-d H:i:s',
- TS_DB2 => 'Y-m-d H:i:s',
);
/**
*
* @since 1.20
*
- * @param $timestamp bool|string Timestamp to set, or false for current time
+ * @param bool|string $timestamp Timestamp to set, or false for current time
*/
public function __construct( $timestamp = false ) {
$this->setTimestamp( $timestamp );
*
* @since 1.20
*
- * @param $ts string|bool Timestamp to store, or false for now
+ * @param string|bool $ts Timestamp to store, or false for now
* @throws TimestampException
*/
public function setTimestamp( $ts = false ) {
# TS_POSTGRES
} elseif ( preg_match( '/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)\.*\d* GMT$/', $ts, $da ) ) {
# TS_POSTGRES
- } elseif (preg_match( '/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)\.\d\d\d$/', $ts, $da ) ) {
- # TS_DB2
} elseif ( preg_match( '/^[ \t\r\n]*([A-Z][a-z]{2},[ \t\r\n]*)?' . # Day of week
'\d\d?[ \t\r\n]*[A-Z][a-z]{2}[ \t\r\n]*\d{2}(?:\d{2})?' . # dd Mon yyyy
'[ \t\r\n]*\d\d[ \t\r\n]*:[ \t\r\n]*\d\d[ \t\r\n]*:[ \t\r\n]*\d\d/S', $ts ) ) { # hh:mm:ss
try {
$final = new DateTime( $strtime, new DateTimeZone( 'GMT' ) );
- } catch(Exception $e) {
+ } catch( Exception $e ) {
throw new TimestampException( __METHOD__ . ' Invalid timestamp format.' );
}
*
* @since 1.20
*
- * @param $style int Constant Output format for timestamp
+ * @param int $style Constant Output format for timestamp
* @throws TimestampException
* @return string The formatted timestamp
*/