wc_format_datetime()
Format a date for output.
No Hooks.
Return
String
.
Usage
wc_format_datetime( $date, $format );
- $date(WC_DateTime) (required)
- Instance of WC_DateTime.
- $format(string)
- Data format.
Default: wc_date_format function if not set
Changelog
Since 3.0.0 | Introduced. |
wc_format_datetime() wc format datetime code WC 8.7.0
function wc_format_datetime( $date, $format = '' ) { if ( ! $format ) { $format = wc_date_format(); } if ( ! is_a( $date, 'WC_DateTime' ) ) { return ''; } return $date->date_i18n( $format ); }