Jump to content

Help with time format needed


davidwhiteuk

Recommended Posts

Hello, I have a website I programmed with PHP and MySQL. When I take a record from the database, one of the fields is a timestamp and the date is in the format 2009-08-04 17:08:37 or YYYY-MM-DD HH:MM:SS

 

How do I change this so I can make it appear as 4th August 2009 on the site?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/168818-help-with-time-format-needed/
Share on other sites

Hello, I have a website I programmed with PHP and MySQL. When I take a record from the database, one of the fields is a timestamp and the date is in the format 2009-08-04 17:08:37 or YYYY-MM-DD HH:MM:SS

 

How do I change this so I can make it appear as 4th August 2009 on the site?

 

thanks

like this,

<?php
$date_frm_database="2009-08-04 17:08:37";
$date=date("jS F Y",strtotime($date_frm_database));
echo $date;
?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.