Documentation

ColModifierDate extends SortedColModifier
in package

Converts a MySQL date into something friendlier. Works for DATE, TIME, DATETIME AND [BIG]INT.

The default output format is d/m/Y, but can be changed in the constructor. Format strings are anything supported by the PHP function date().

Table of Contents

Properties

$_format  : mixed
$_time_col  : mixed
$_timezone  : mixed

Methods

__construct()  : mixed
modify()  : string
Modify a column value This value will be html/csv/etc encoded afterwards.
modifyTimezone()  : void
Modify the timezone of a date object

Properties

Methods

__construct()

public __construct([string $format = 'd/m/Y' ][, string $timezone = null ][, string $time_col = null ]) : mixed
Parameters
$format : string = 'd/m/Y'

The format (see PHP's date function, )

$timezone : string = null

The text identifier for the timezone to modify to, )

$time_col : string = null

The name of the column which contains the timezone identifier (if any)

modify()

Modify a column value This value will be html/csv/etc encoded afterwards.

public modify(string $val, string $field_name, array<string|int, mixed> $row) : string
Parameters
$val : string

The incoming value

$field_name : string

The name of the field being modified

$row : array<string|int, mixed>

The full row of data

Return values
string —

The modified value

modifyTimezone()

Modify the timezone of a date object

private modifyTimezone(DateTime &$date) : void
Parameters
$date : DateTime

The date object to modify directly

On this page

Search results