to string method

This commit is contained in:
Mike Jolley 2017-03-08 18:14:37 +00:00
parent b5454f3403
commit 94eaa67bc9
1 changed files with 15 additions and 0 deletions

View File

@ -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() {