Documentation

IMP_Message_Date
in package

Common code dealing with date formatting for messages.

Tags
author

Michael Slusarz slusarz@horde.org

category

Horde

copyright

2006-2017 Horde LLC

license

http://www.horde.org/licenses/gpl GPL

Table of Contents

Constants

DATE_FORCE  = 1
DATE_FULL  = 2
DATE_ISO_8601  = 4
DATE_LOCAL  = 3

Properties

$_cache  : array<string|int, mixed>
Shared cache.
$_date  : Horde_Imap_Client_DateTime
The date object.

Methods

__construct()  : mixed
Constructor.
__toString()  : mixed
format()  : string
Formats the date.
_buildCache()  : mixed
Build the date cache.
_format()  : string
Format the date/time.

Constants

DATE_FORCE

public mixed DATE_FORCE = 1

DATE_FULL

public mixed DATE_FULL = 2

DATE_ISO_8601

public mixed DATE_ISO_8601 = 4

DATE_LOCAL

public mixed DATE_LOCAL = 3

Properties

$_cache

Shared cache.

private static array<string|int, mixed> $_cache = array()

$_date

The date object.

private Horde_Imap_Client_DateTime $_date

Methods

__construct()

Constructor.

public __construct([Horde_Imap_Client_DateTime|string $date = null ]) : mixed
Parameters
$date : Horde_Imap_Client_DateTime|string = null

The date.

__toString()

public __toString() : mixed

format()

Formats the date.

public format([int $format = 0 ]) : string
Parameters
$format : int = 0

Formatting options:

  • DATE_FORCE: Force use of date formatting, instead of time formatting, for all dates.
  • DATE_FULL: Use full representation of date, including time information.
  • DATE_ISO_8601: Return ISO 8601 formatted date.
  • DATE_LOCAL: Display localized formatting (with timezone information). Displays "Today" for the current date.
Return values
string

The formatted date string.

_buildCache()

Build the date cache.

private _buildCache() : mixed

_format()

Format the date/time.

private _format(string $type, int $udate) : string
Parameters
$type : string

The date/time preference name.

$udate : int

The UNIX timestamp.

Return values
string

Formatted date/time string.


        
On this page

Search results