to string method
This commit is contained in:
parent
b5454f3403
commit
94eaa67bc9
|
@ -8,14 +8,27 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* WC Wrapper for PHP DateTime.
|
||||
*
|
||||
* @class WC_DateTime
|
||||
* @since 2.7.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
*/
|
||||
class WC_DateTime extends DateTime {
|
||||
|
||||
/**
|
||||
* Output an ISO 8601 date string in local timezone.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @return string
|
||||
*/
|
||||
public function __toString() {
|
||||
return $this->format( DATE_ATOM );
|
||||
}
|
||||
|
||||
/**
|
||||
* Missing in PHP 5.2.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @return int
|
||||
*/
|
||||
public function getTimestamp() {
|
||||
|
@ -24,6 +37,8 @@ class WC_DateTime extends DateTime {
|
|||
|
||||
/**
|
||||
* Get the timestamp with the WordPress timezone offset added or subtracted.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @return int
|
||||
*/
|
||||
public function getOffsetTimestamp() {
|
||||
|
|
Loading…
Reference in New Issue