DATA Methods

date()

Use this function to convert an SQL date into a date depending on your language settings.

string date( date sql_date [, string format [, bool validate = false ]])

Return

Formatted date.

Parameter
Description
sql_dateSQL formatted date or any other date type value.
formatPHP date format. If no format is passed, the date will be formatted according to the config settings.
validateCheck if valid date.

Show date according to config setting

$DATA->date("1970-12-21")
RETURN: '21/12/1970'

Show european date

$DATA->date('1999-12-24', 'd.m.Y')
RETURN: '24.12.1999'