/var/www/html_uk/wp-content/plugins/automatewoo/includes/Variables/AbstractTime.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php

namespace AutomateWoo\Variables;

use 
AutomateWoo\DateTime;
use 
AutomateWoo\Variable;

defined'ABSPATH' ) || exit;

/**
 * Class AbstractTime
 *
 * @since 5.4.0
 */
abstract class AbstractTime extends Variable {

    
/**
     * Formats a time variable using the wc_time_format()
     *
     * @param DateTime $datetime
     *
     * @return string
     */
    
protected function format_value_from_utc_tzDateTime $datetime ): string {
        
$datetime->convert_to_site_time();
        return 
$datetime->format_i18nwc_time_format() );
    }

    
/**
     * Formats a time variable using the wc_time_format()
     *
     * @param DateTime $datetime
     *
     * @return string
     */
    
protected function format_value_from_local_tzDateTime $datetime ): string {
        return 
$datetime->format_i18nwc_time_format() );
    }
}