pfeifferNet

Date_Time
in package

Date and time formatting and handling.

Tags
since
1.4.0
since
5.9.0

Refactored to use modern wp_date function.

since
5.11.0

Deprecated global singleton.

Table of Contents

Properties

$date_pattern  : string
Date format.
$date_time_pattern  : string
Date and time format.
$instances  : array<string|int, object>
The array of instances of this class and sub-classes.
$time_pattern  : string
Time format.

Methods

format_date()  : string
Format a date string and return date in site standard.
get_instance()  : object
Creates and/or returns the instance of this class.
stamp_to_date()  : string
Return formatted date from unix timestamp.
stamp_to_date_time()  : string
Return formatted date and time from unix timestamp.
__construct()  : void
Initialise the class.

Properties

$date_pattern

Date format.

protected string $date_pattern = ''
Tags
since
1.4.0

$date_time_pattern

Date and time format.

protected string $date_time_pattern = ''
Tags
since
1.4.0

$instances

The array of instances of this class and sub-classes.

protected static array<string|int, object> $instances = array()
Tags
since
5.11.0

$time_pattern

Time format.

protected string $time_pattern = ''
Tags
since
1.4.0

Methods

get_instance()

Creates and/or returns the instance of this class.

public static get_instance() : object
Tags
since
5.11.0
Return values
object

The instance of this class.

stamp_to_date()

Return formatted date from unix timestamp.

public stamp_to_date(int $timestamp) : string
Parameters
$timestamp : int

unix timestamp.

Tags
since
1.4.0
used-by
Image::image_metadata()
Return values
string

Formatted date.

stamp_to_date_time()

Return formatted date and time from unix timestamp.

public stamp_to_date_time(int $timestamp) : string
Parameters
$timestamp : int

unix timestamp.

Tags
since
5.10.0
Return values
string

Formatted date.

__construct()

Initialise the class.

protected __construct() : void
Tags
since
1.4.0

        
On this page

Search results