[PHP] Re: date format from a database date field

2007-05-23 Thread Johan Holst Nielsen
Mike Ryan wrote: Sorry I am a bit of a newbie with php and hope this has not been aswered a million times, but here it goes I have a date base with a couple of date fields when I pull up and display the fields it show 2007-05-21. the question I have is how to convert the field to 05-21-2007? Cu

RE: [PHP] Re: date format

2002-04-27 Thread John Holmes
No...Do it in your query. Use DATE_FORMAT in your query. ---John Holmes... > -Original Message- > From: George Nicolae [mailto:[EMAIL PROTECTED]] > Sent: Saturday, April 27, 2002 12:43 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: date format > > try &g

[PHP] Re: date format

2002-04-27 Thread George Nicolae
try -- Best regards, George Nicolae IT Manager ___ PaginiWeb.com - Professional Web Design www.PaginiWeb.com "Ananth Rajaraman" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > I'm trying to query a date field from mySQL and > di

Re: [PHP] Re: DATE FORMAT ISSUES

2001-10-22 Thread Beeman
That worked. Thanks a lot... You rock -Beeman "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Yeah, I select it using UNIX_TIMESTAMP(creation_datetime) and then I am > > using date("M d, Y g:ia",$myrow["creation_datetime"]) at the end of a pri

Re: [PHP] Re: DATE FORMAT ISSUES

2001-10-22 Thread Rasmus Lerdorf
> Yeah, I select it using UNIX_TIMESTAMP(creation_datetime) and then I am > using date("M d, Y g:ia",$myrow["creation_datetime"]) at the end of a printf > statement but the date comes back as Dec 31 1969 7:00pm for all entries. > When the date was inserted I used now() in the insert statement. Yo

Re: [PHP] Re: DATE FORMAT ISSUES

2001-10-22 Thread Beeman
Yeah, I select it using UNIX_TIMESTAMP(creation_datetime) and then I am using date("M d, Y g:ia",$myrow["creation_datetime"]) at the end of a printf statement but the date comes back as Dec 31 1969 7:00pm for all entries. When the date was inserted I used now() in the insert statement. "Rasmus Ler

Re: [PHP] Re: DATE FORMAT ISSUES

2001-10-22 Thread Rasmus Lerdorf
Are you retrieving it using MySQL's UNIX_TIMESTAMP() function? PHP's date() function needs a unix timestamp to work with. -Rasmus On Mon, 22 Oct 2001, Beeman wrote: > No it is definitely a DATETIME and the date and time are correct in the > database, but when I try to format and display them t

[PHP] Re: DATE FORMAT ISSUES

2001-10-22 Thread Beeman
No it is definitely a DATETIME and the date and time are correct in the database, but when I try to format and display them the date is correct but the time is not "_lallous" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > maybe you have in your database a DATE

[PHP] Re: DATE FORMAT ISSUES

2001-10-22 Thread _lallous
maybe you have in your database a DATE field instead of DATETIME field? "Beeman" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have inserted the date into MySQL using now() in the query. However, when > I retrieve the using MySQL_Date_Format in the query th