WordPress at Your Fingertips
function is not described

WC_Customer_Download_Data_Store::adjust_date_for_db() private WC 1.0

Adjust a date value to be inserted in the database.

{} It's a method of the class: WC_Customer_Download_Data_Store{}

No Hooks.

Return

String. The date converted to 'Y-m-d' format.

Usage

// private - for code of main (parent) class only
$result = $this->adjust_date_for_db( $date );
$date(mixed) (required)
The date value. Can be a WC_DateTime, a timestamp, or anything else that "date" recognizes.

Code of WC_Customer_Download_Data_Store::adjust_date_for_db() WC 5.7.1

private function adjust_date_for_db( $date ) {
	if ( 'WC_DateTime' === get_class( $date ) ) {
		$date = $date->getTimestamp();
	}

	$adjusted_date = date( 'Y-m-d', $date ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date

	if ( $adjusted_date ) {
		return $adjusted_date;
	}

	$msg = sprintf( __( "I don't know how to get a date from a %s", 'woocommerce' ), is_object( $date ) ? get_class( $date ) : gettype( $date ) );
	throw new Exception( $msg );
}