PHP offers a large variety of arguments that can be passed to the date() function. You are able to almost everything you want having just the current time stamp. I’ve selected the most useful readable formats – I think you might need it for any purpose. I used it to randomize a site’s content to vary posting dates. So, here is the list:
F j, Y
F j, y
F d, Y
F d, y
d-M-Y
d-M-y
j-M-y
j-M-Y
d/n/y
d/m/y
d/n/Y
d/m/Y
j/m/y
j/m/Y
j/n/y
j/n/Y
Y-m-j
Y-n-j
Y-m-d
Y-n-d
n/d/y
m/d/y
n/d/Y
m/d/Y
m/j/y
n/j/y
m/j/Y
n/j/Y
d.m.Y
d.m.y
d.n.Y
d.n.y
j.m.Y
j.n.Y
j.m.y
j.m.y
m-j-Y
n-j-Y
m-d-Y
n-d-Y
Most of these date formats look well and I hope you find it useful
Categories: PHP Solutions Tags: date formats php, human friendly php date format, human readable date, human readable dates php, php date ago human, php date format, php date format list, php date to readable format, php format date d/m/y, php human date, php human friendly dates, php human readable date ago
Often you need to generate a timestamp with PHP. It should represent the current date or the date in the future. It should show the date, month and year in all possible readable formats. I’ve created a list that has most often used date formats. Here it is:
F j, Y
F j, y
F d, Y
F d, y
d-M-Y
d-M-y
j-M-y
j-M-Y
d/n/y
d/m/y
d/n/Y
d/m/Y
j/m/y
j/m/Y
j/n/y
j/n/Y
Y-m-j
Y-n-j
Y-m-d
Y-n-d
n/d/y
m/d/y
n/d/Y
m/d/Y
m/j/y
n/j/y
m/j/Y
n/j/Y
d.m.Y
d.m.y
d.n.Y
d.n.y
j.m.Y
j.n.Y
j.m.y
j.m.y
m-j-Y
n-j-Y
m-d-Y
n-d-Y
Usage is quite simple.
<?
$guess=mktime (0,0,0,date(“m”),date(“d”),date(“Y”));
$data=date($dateformat, $guess);
?>
Just use the date format you like and set the date for formatting (it is set to today by default) and insert this code anywhere you need to have the date displayed in the appropriate format.