For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > November 2004 > Displaying Dates How You Want









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Displaying Dates How You Want
C. David Rossen

2004-11-25, 3:56 am

Hello:

I have a talbe where there are 4 fields which involve dates and times. I
have a php file named output.php and here is how I am doing it:

$date1=mysql_result($result,$i,"date1");
$date2=mysql_result($result,$i,"date2");
$time1=mysql_result($result,$i,"time1");
$time2=mysql_result($result,$i,"time2");

This displays the data captured from the html form that I have. date1 &
date2 are date fields and time1 and time2 are time fields. How would I
display them? For example, date1 is now displaying like 2004-12-03. I
understand that because that is how a date field is formatted in MySQL. But
how would I get it to display, something like: Friday, 12/03/04? Same with
time...how would I format it to display say 9:00 AM instead of 09:00:00?

Thanks.

David


David Quinton

2004-11-25, 8:58 am

On Wed, 24 Nov 2004 21:29:54 -0800, "C. David Rossen"
<cdrossen@cdrmarketing.com> wrote:
>how would I format it to display say 9:00 AM instead of 09:00:00?


<http://uk2.php.net/manual/en/function.date.php>

--
Interesting Xmas gifts: <http://www.awin1.com/tclick.php?id=405&mid=182> . <http://BizOrg.co.uk/shopping/>
Locate your Mobile phone: <http://www.bizorg.co.uk/news.html>
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com