Verified Commit d8581842 authored by Erick Hitter's avatar Erick Hitter
Browse files

Time format should be shared

parent 15ecf92a
......@@ -6,6 +6,11 @@ if ( ! defined( '\WP_CLI' ) || ! \WP_CLI ) {
return;
}
/**
* Consistent time format across commands
*/
const TIME_FORMAT = 'Y-m-d H:i:s';
/**
* Clear all of the caches for memory management
*/
......
......@@ -6,8 +6,6 @@ namespace Automattic\WP\Cron_Control\CLI;
* Manage Cron Control's data, including internal caches
*/
class Data extends \WP_CLI_Command {
private $time_format = 'Y-m-d H:i:s';
/**
* Flush Cron Control's internal caches
*
......@@ -148,9 +146,9 @@ class Data extends \WP_CLI_Command {
'ID' => $event->ID,
'action' => '',
'instance' => '',
'next_run_gmt' => date( $this->time_format, strtotime( $event->post_date_gmt ) ),
'next_run_gmt' => date( TIME_FORMAT, strtotime( $event->post_date_gmt ) ),
'next_run_relative' => $this->calculate_interval( strtotime( $event->post_date_gmt ) - time() ),
'last_updated_gmt' => date( $this->time_format, strtotime( $event->post_modified_gmt ) ),
'last_updated_gmt' => date( TIME_FORMAT, strtotime( $event->post_modified_gmt ) ),
'recurrence' => __( 'Non-repeating', 'automattic-cron-control' ),
'schedule_name' => __( 'n/a', 'automattic-cron-control' ),
'event_args' => '',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment