Automattic\WooCommerce\Admin

WCAdminHelper::get_wcadmin_active_for_in_seconds()public staticWC 1.0

Get the number of seconds that the store has been active.

Method of the class: WCAdminHelper{}

No Hooks.

Return

number. Number of seconds.

Usage

$result = WCAdminHelper::get_wcadmin_active_for_in_seconds();

WCAdminHelper::get_wcadmin_active_for_in_seconds() code WC 8.6.1

public static function get_wcadmin_active_for_in_seconds() {
	$install_timestamp = get_option( self::WC_ADMIN_TIMESTAMP_OPTION );

	if ( ! is_numeric( $install_timestamp ) ) {
		$install_timestamp = time();
		update_option( self::WC_ADMIN_TIMESTAMP_OPTION, $install_timestamp );
	}

	return time() - $install_timestamp;
}