Forum Moderators: coopster

Message Too Old, No Replies

How to convert the Curdate() function to format dd/mm/yyyy

         

godsteruk

7:28 pm on Apr 16, 2009 (gmt 0)

10+ Year Member



As it says on the tin. Does anyone know how to convert the results of the curdate function, which is stored in the 'postdate' field of my table so that when I output (echo) this as a variable I am able to manipulate how it displays.

Looking to have either:

dd/mm/yyyy

or even full text date

Saturday 11th Aprill 2009

Any help would ve appreciated.

coopster

7:33 pm on Apr 16, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Most databases have built in Date and Time Functions that allow you to format as you desire. For example, MySQL has DATE_FORMAT [dev.mysql.com]. Otherwise you could use a combination of
POSITION
and
SUBSTRING
.