Menu

## ActionScheduler_TimezoneHelper
in package

ActionScheduler_TimezoneHelper.php : 6

Class ActionScheduler_TimezoneHelper

### Table of Contents

$local_timezone : mixed
get_local_timezone() : mixed
set_local_timezone() : ActionScheduler_DateTime
  Set a DateTime's timezone to the WordPress site's timezone, or a UTC offset if no timezone string is available.
get_local_timezone_offset() : float
  Get timezone offset in seconds.
get_local_timezone_string() : string
  Helper to retrieve the timezone string for a site until a WP core method exists (see https://core.trac.wordpress.org/ticket/24730).

### Properties

#### $local_timezone

ActionScheduler_TimezoneHelper.php : 7
`private static mixed $local_timezone = NULL`

### Methods

#### get_local_timezone()

ActionScheduler_TimezoneHelper.php : 102
`public static get_local_timezone([mixed $reset = FALSE ]) : mixed`

##### Parameters

$reset : mixed = FALSE

##### Tags

deprecated
  2.1.0

##### Return values

mixed —

#### set_local_timezone()

ActionScheduler_TimezoneHelper.php : 18

Set a DateTime's timezone to the WordPress site's timezone, or a UTC offset if no timezone string is available.

`public static set_local_timezone(DateTime $date) : ActionScheduler_DateTime`

##### Parameters

$date : DateTime

##### Tags

since
  2.1.0

##### Return values

ActionScheduler_DateTime —

#### get_local_timezone_offset()

ActionScheduler_TimezoneHelper.php : 88

Get timezone offset in seconds.

`protected static get_local_timezone_offset() : float`

##### Tags

since
  2.1.0

##### Return values

float —

#### get_local_timezone_string()

ActionScheduler_TimezoneHelper.php : 47

Helper to retrieve the timezone string for a site until a WP core method exists (see https://core.trac.wordpress.org/ticket/24730).

`protected static get_local_timezone_string([mixed $reset = false ]) : string`

Adapted from wc_timezone_string() and https://secure.php.net/manual/en/function.timezone-name-from-abbr.php#89155.

If no timezone string is set, and its not possible to match the UTC offset set for the site to a timezone string, then an empty string will be returned, and the UTC offset should be used to set a DateTime's timezone.

##### Parameters

$reset : mixed = false

##### Tags

since
  2.1.0

##### Return values

string —

PHP timezone string for the site or empty if no timezone string is available.

## Search results