Skip to main content

DateFormat PHP Class

Published on
DateFormat is a PHP class for easily displaying timestamps in a PHP project, along with displaying a "time since" feature, much like the one used on Facebook and other sites. A  demo of the class is available in my script playground:

DateFormat Class Documentation

Initialize Class

$date = new FormatDate(time());

Numerical Day


Text Day


Month (Full)


Month (Short)


Month (Numerical)


Year (Full)


Year (Short)


Military (Seconds)


Military (No seconds)


Standard (Full)




Text Date (Full)


Text Date (Short)


Numerical Date (Full)


Numerical Date (Short)


Month and Day (Full)


Month and Day (Short)


Time Since