Date formatting problem
Posted: Thu Oct 07, 2004 12:40 pm
I know this must be a really easy one, but please bear with me as a total newbie.
I'm trying my first attempts with MySQL and PHP. I've defined a database table with the field UpdateDate defined as DATE. An entry for the 15 October 2004 shows correctly as 2004-10-15 when I select the table.
Now, I want to display that field as '15 Oct 2004' on my web page. It is defying my attempts to do so. I have tried the sql Date_Format function on the field in the Select command and got a blank output. When I extract the UpdateDate field from the row and try to use the php Date() command on it I get either blank output or rubbish dates.
Can anyone please help - in very simple code terms - and explain where I might be going wrong. This is driving me nuts.
I'm trying my first attempts with MySQL and PHP. I've defined a database table with the field UpdateDate defined as DATE. An entry for the 15 October 2004 shows correctly as 2004-10-15 when I select the table.
Now, I want to display that field as '15 Oct 2004' on my web page. It is defying my attempts to do so. I have tried the sql Date_Format function on the field in the Select command and got a blank output. When I extract the UpdateDate field from the row and try to use the php Date() command on it I get either blank output or rubbish dates.
Can anyone please help - in very simple code terms - and explain where I might be going wrong. This is driving me nuts.