[PHP] Re: format date field

2007-05-23 Thread itoctopus
SELECT DATE_FORMAT('open', '%m-%d-%Y') FROM your_table_name;

-- 
itoctopus - http://www.itoctopus.com
Mike Ryan [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
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 field???

 while I am at it how can I accept the date field as 05-01-2007; 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Format Date

2002-11-07 Thread Erwin
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 ?

try

print date( 'd/m/Y', strtotime( $array['date'] ) );

HTH
Erwin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php