WC_API_Coupons::get_coupon_expiry_date() protected WC 2.3.0
expiry_date format
{} It's a method of the class: WC_API_Coupons{}
No Hooks.
Return
String|Int.
Usage
// protected - for code of main (parent) or child class $result = $this->get_coupon_expiry_date( $expiry_date, $as_timestamp );
- $expiry_date(string) (required)
- -
- $as_timestamp(true/false)
- (default: false)
Changelog
Since 2.3.0 | Introduced. |
Code of WC_API_Coupons::get_coupon_expiry_date() WC API Coupons::get coupon expiry date WC 5.0.0
protected function get_coupon_expiry_date( $expiry_date, $as_timestamp = false ) {
if ( '' != $expiry_date ) {
if ( $as_timestamp ) {
return strtotime( $expiry_date );
}
return date( 'Y-m-d', strtotime( $expiry_date ) );
}
return '';
}