WC_API_Coupons::get_coupon_expiry_date( string $expiry_date, bool $as_timestamp = false )

expiry_date format


Description Description


Parameters Parameters

$expiry_date

(Required)

$as_timestamp

(Optional) (default: false)

Default value: false


Top ↑

Return Return

(string|int)


Top ↑

Source Source

File: includes/legacy/api/v2/class-wc-api-coupons.php

	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 '';
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.