Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting dates

Status
Not open for further replies.

steijssen

Programmer
Mar 25, 2001
92
BE
Hi,
I've got to format a date I get from a mysql field named date_in like this:

Friday - April 13, 2001

the date in the mysql db field is formatted like 04-13-2001.

Does anyone know how I can do this?

Thanks in advance!
 
Here is how I have done this in my applications.

The mysql db date field should store the date in the "0000-00-00" format (year-month-date). If you dumped the date of a record into a variable called $sql_date, you can reformat that date with

Code:
list($date_year, $date_month, $date_day) = explode ("-",$sql_date);
$format_date = date("l - F j, Y",mktime(0,0,0,$date_month,$date_day,$date_year));
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top