[PHP-DB] simple date formatting?

2003-06-11 Thread Steve B.
Hi I'm looking to format a date but all I find is this date() function and it appears 
to be for
current date?

My variable $dbrec[ListDate] is printing:
4/30/2003 0:00:00

It needs to print
4/30/2003

Am I on the right track to try to do a (with right parameters)

$formatted_date = date(M D Y,$dbrec[ListDate]);
or
$formatted_date = date_format(M D Y,$dbrec[ListDate]);

Thanks
Current code just chops it off:
print tdfont color='white'b.substr($dbrec[ListDate],0,9)./td;
  

__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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



RE: [PHP-DB] simple date formatting?

2003-06-11 Thread Hutchins, Richard
Building off of one of John Holmes's posts from yesterday:

$f_date = date('n/d/Y',strtotime($yourDBdate));

should do the trick.

Hope this helps.

Rich

 -Original Message-
 From: Steve B. [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 11, 2003 2:53 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] simple date formatting?
 
 
 Hi I'm looking to format a date but all I find is this date() 
 function and it appears to be for
 current date?
 
 My variable $dbrec[ListDate] is printing:
 4/30/2003 0:00:00
 
 It needs to print
 4/30/2003
 
 Am I on the right track to try to do a (with right parameters)
 
 $formatted_date = date(M D Y,$dbrec[ListDate]);
 or
 $formatted_date = date_format(M D Y,$dbrec[ListDate]);
 
 Thanks
 Current code just chops it off:
 print tdfont 
 color='white'b.substr($dbrec[ListDate],0,9)./td;
   
 
 __
 Do you Yahoo!?
 Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
 http://calendar.yahoo.com
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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