Re: [PHP] format date field

2007-05-24 Thread Richard Lynch
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 t

Re: [PHP] format date field

2007-05-23 Thread Kevin Murphy
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 www.

Re: [PHP] format date field

2007-05-23 Thread Greg Donald
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 fie

Re: [PHP] Format Date

2002-11-07 Thread Marek Kilimajer
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 Fla

Re: [PHP] Format Date

2002-11-07 Thread 1LT John W. Holmes
> 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 fo

Re: [PHP] format date

2002-04-16 Thread Erik Price
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 > othe

Re: [PHP] format date

2002-04-16 Thread Robert Cummings
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'; Che

RE: [PHP] format date

2002-04-16 Thread Steve Bradwell
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 [mailto

RE: [PHP] format date

2001-10-23 Thread Mark Roedel
> -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',

Re: [PHP] format date

2001-10-23 Thread Andrey Hristov
ve > 410 Frimley Business Park > Frimley, Surrey. GU16 7ST > United Kingdom > Telephone : +44 (0)1276 808300 > > > > From: David Robley <[EMAIL PROTECTED]> > > >Reply-To: [EMAIL PROTECTED] > >To: "Caleb Carvalho" <[EMAIL PROTECTED]>, [EMAI

Re: [PHP] format date

2001-10-23 Thread Caleb Carvalho
United Kingdom Telephone : +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,

Re: [PHP] format date

2001-10-22 Thread David Robley
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 doin