display date from database and format it with php

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
siesmith
Forum Newbie
Posts: 1
Joined: Fri Jun 28, 2002 1:29 pm

display date from database and format it with php

Post by siesmith »

hi guys
:roll:
I wish to take the date(timestamp) from the database and display it on my web page in a more readable format.
instead of 2002-06-26
i wish to format it in php to: for example, wednesday 26th july 02

i used this code ".date("D M j y", $Row[Date])."
and this was the result

Thu Jan 1 70 Farnworth, Bolton, Lancs The Moses Gate
Thu Jan 1 70 South Shields The Office

please help

kind regards
sie
User avatar
sam
Forum Contributor
Posts: 217
Joined: Thu Apr 18, 2002 11:11 pm
Location: Northern California
Contact:

Post by sam »

User avatar
martin
Forum Commoner
Posts: 33
Joined: Fri Jun 28, 2002 12:59 pm
Location: Cambridgeshire

Post by martin »

mysql can format for you:
select date_format(tablename.date,'%W-%D-%M-%Y') as formatdate
Post Reply