On Wed, May 23, 2007 11:45 am, Mike Ryan wrote:
I am reading in a date field from a mysql database the field on the
screen
shows up as 2007-05-01 on the screen I would like the field to show
05-01-2007 currently I am issueing the following command print
$row['open']; how can I format this
On 5/23/07, Mike Ryan [EMAIL PROTECTED] wrote:
I am reading in a date field from a mysql database the field on the screen
shows up as 2007-05-01 on the screen I would like the field to show
05-01-2007 currently I am issueing the following command print
$row['open']; how can I format this
Leave the date as is, its a MySQL thing. To format it on your page,
use the date function:
$formattedDate = date(m-d-Y,strtotime($row[open]));
http://us2.php.net/manual/en/function.date.php
--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada Community College
When i print a date, the format of this date is: 8 nov
2001 0:00
(print ($array[date]))
but i need print this: 08/11/2001
how i print this ?
Hmmm... well I want to say RTFM, but in light of the recent posts... :)
Take a look at the date() function.
www.php.net/date
You can format
you can do date('d/m/Y',strtotime($array['date'])), or better would be
to change
the format at the source
dark rotter wrote:
Hi,
When i print a date, the format of this date is: 8 nov
2001 0:00
(print ($array[date]))
but i need print this: 08/11/2001
how i print this ?
ass.: Augusto
Hey Alex,
I use a short function like this because the date is really just a string
you can pick it apart and re-arrange it.
function Format_Date($Date){
return $Date =
((substr($Date,6,2)).-.(substr($Date,0,2)).-.(substr($Date,3,2)));
}
Steve.
-Original Message-
From: Alex
Change your query, mySQL provides some powerful formatting functions for
doing exactly what you want:
SELECT id,
fname,
lname,
DATE_FORMAT( date, '%m/%d/%Y' )
FROM tablename where date = '$year_1-month_1-$day_1-'
AND
date = '$year_2-$month_2-$day_2';
On Tuesday, April 16, 2002, at 01:35 PM, Alex wrote:
I just started with php and am trying to display a query result for a
date
field as mm/dd/ instead of mysql's -mm-dd. I looked through
some
books and found the use of DATE_FORMAT to covert the dates. Is there any
other way
: +44 (0)1276 808300
From: David Robley [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Caleb Carvalho [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: [PHP] format date
Date: Tue, 23 Oct 2001 10:02:26 +0930
On Mon, 22 Oct 2001 22:38, Caleb Carvalho wrote:
Hi all,
i would like a simple way
PROTECTED]
To: Caleb Carvalho [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: [PHP] format date
Date: Tue, 23 Oct 2001 10:02:26 +0930
On Mon, 22 Oct 2001 22:38, Caleb Carvalho wrote:
Hi all,
i would like a simple way to get date field formatted from my little
sybase,
for some
-Original Message-
From: Caleb Carvalho [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 23, 2001 2:53 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] format date
I am inserting into table
values('$product','$title,'$date')
the date field gets added
On Mon, 22 Oct 2001 22:38, Caleb Carvalho wrote:
Hi all,
i would like a simple way to get date field formatted from my little
sybase,
for some reason the output of it is showing the wrong date
example Jan 1 1900 12:00:00:000AM
thanks
Perhaps if you could show what you are doing and
12 matches
Mail list logo