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
$_format
private
mixed
$_format
$_time_col
private
mixed
$_time_col
$_timezone
private
mixed
$_timezone
Methods
__construct()
public
__construct([string $format = 'd/m/Y' ][, string $timezone = null ][, string $time_col = null ]) : mixed
Parameters
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