I have a timestamp column in a mysql table.

Using PHP, how do I convert the timestamp format which is "YYYY-MM-DD HH:MM:SS" into a format like "March 16 2008, 08:41 am" ?


Please help

Thanx

basically there are two ways of solving it. The first is the explode the data into chunks and then converting them.

secondy, in my opinion the better and easier way:
use the function date("prefered format",mktime(...))
first arguments is you format that you like.
the secend argument created an unix-timestamp (look at http://de2.php.net/manual/en/function.mktime.php). it allows you to generate any date and time you like.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.