Function dateFormat
format a date string
formats:
d => day with null on beginning (ex: 01)
j => day without null on beginning (ex: 1)
m => month with null on beginning (ex: 08)
n => month without null on beginning (ex: 8)
y => year with 2 digits (ex: 97)
Y => year with 4 digits (ex: 1997)
H => 24-Hour format with null on beginning ( 00-23)
h => 12-Hour format with null on beginning (01-12)
g => 12-Hour format without null on beginning (1-12)
G => 24-Hour format without null on beginning (0-23)
i => minutes (00-59)
s => seconds (00-59)
D => weekday name abbreviation (ex: Sun)
l => complete weekday name (ex: Sunday)
M => month name abbreviation (ex: Feb)
F => complete month name (ex: February)
samples:
dateFormat("20060101235527","dmYHis",false,false,"de") => 01.01.2006 23:55:27
dateFormat("2007-08-23 23:55:27","YMd",false,false,"us") => Aug 23 2007
dateFormat("2007-08-23","d.m.Y") => 23.08.2007
Parameters summary
string |
$string |
|
string |
$format = 'Y-m-d H:i:s' |
|
boolean |
$checkDate = false |
|
boolean |
$returnNowOnError = true |
returnNowOnError |
string |
$countryCode = "" |
(en, us, de, es, fr) |