Thursday, May 16, 2013

Date codes in PHP

OK... so you are coding a dynamic date field in PHP, well these codes will come in handy when working out how to show say 01 Jan '13... or Mon 01 January 2013 for example.

d = "01" to "31"
j = "1" to "31" (no leading zero)
l = "Monday" through "Sunday"
D = "Mon" through "Sun"
F = "January" through "December"
M = "Jan" through "Dec"
Y = "2013"
y = "13"

To view the full date functions, click here.


Enjoy!