src/DateTime.php
protected function normalize_date_time( $value ) {

		if ( $value === '' || $value === NULL ) {
			return $value;
		}
		if ( ! is_string( $value ) && ! is_int( $value ) && ! $value instanceof DateTime ) {
			return $value;
		}
		if ( is_int( $value ) ) {
			//timestamp
			$value = new \DateTime( '@' . $value );
		} elseif ( ! $value instanceof DateTime ) {
			$value = new \DateTime( $value );
		}

		return $value->format( $this->options[ 'format' ] );
	}
protected function normalize_date_time( $value ) {

		if ( $value === '' || $value === NULL ) {
			return $value;
		}
		if ( ! is_string( $value ) && ! is_int( $value ) && ! $value instanceof DateTime ) {
			return $value;
		}
		if ( is_int( $value ) ) {
			//timestamp
			$value = new \DateTime( '@' . $value );
		} elseif ( ! $value instanceof DateTime ) {
			$value = new \DateTime( $value );
		}

		return $value->format( $this->options[ 'format' ] );
	}
protected function normalize_date_time ( $ value ) { if ( $ value === '' || $ value === NULL ) { return $ value ; } if ( ! is_string ( $ value ) && ! is_int ( $ value ) && ! $ value instanceof DateTime ) { return $ value ; } if ( is_int ( $ value ) ) { //timestamp $ value = new \ DateTime ( '@' . $ value ) ; } elseif ( ! $ value instanceof DateTime ) { $ value = new \ DateTime ( $ value ) ; } return $ value -> format ( $ this -> options [ 'format' ] ) ; }
Normalize the provided value to a formatted string.

@param  string|int|DateTime $value

@return string
Normalize the provided value to a formatted string .