ActionScheduler_WPCLI_Command::get_schedule_display_string()protectedWC 1.0

Get the scheduled date in a human friendly format.

Method of the class: ActionScheduler_WPCLI_Command{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_schedule_display_string( $schedule );
$schedule(ActionScheduler_Schedule) (required)
Schedule.

Notes

ActionScheduler_WPCLI_Command::get_schedule_display_string() code WC 9.8.1

protected function get_schedule_display_string( ActionScheduler_Schedule $schedule ) {

	$schedule_display_string = '';

	if ( ! $schedule->get_date() ) {
		return '0000-00-00 00:00:00';
	}

	$next_timestamp = $schedule->get_date()->getTimestamp();

	$schedule_display_string .= $schedule->get_date()->format( static::DATE_FORMAT );

	return $schedule_display_string;
}