[PHP-DB] Date format in MySQL

2003-02-03 Thread RUBANOWICZ Lisa
Hi All, I have a date format of -MM-DD in MySQL and am showing it on a PHP page.  
However I want to show it as 
"2 February, 2003"
or "2 February"
Can someone please help me.  The date will not necessarily be todays date (I looked at 
the datetime() function and the getdate() function but couldn't work it out for these)
Thanks for your support
All the best
Lisa

Lisa Rubanowicz
CNH Ireland
Tel: +353 46 77663
Email:   [EMAIL PROTECTED]

 

 



Re: [PHP-DB] Date format in MySQL

2003-02-03 Thread John Krewson
strftime()

offers a lot of formatting options for dates.

Hope it helps.

RUBANOWICZ Lisa wrote:

Hi All, I have a date format of -MM-DD in MySQL and am showing it on a PHP page.  However I want to show it as 
"2 February, 2003"
or "2 February"
Can someone please help me.  The date will not necessarily be todays date (I looked at the datetime() function and the getdate() function but couldn't work it out for these)
Thanks for your support
All the best
Lisa

Lisa Rubanowicz
CNH Ireland
Tel: +353 46 77663
Email:   [EMAIL PROTECTED]

 

 


--
John Krewson
Programmer - SWORPS


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




Re: [PHP-DB] Date format in MySQL

2003-02-03 Thread Jeffrey_N_Dyke

Or if you want to change it when you're pulling out of mysql you can use
the DATE_FORMAT( ) function...

hth
jeff


   
  
John Krewson   
  
  
s.utk.edu>cc: "'[EMAIL PROTECTED]'" 
<[EMAIL PROTECTED]>
              Subject: Re: [PHP-DB] Date format in 
MySQL 
02/03/2003 
  
09:32 AM   
  
   
  
   
  




strftime()

offers a lot of formatting options for dates.

Hope it helps.

RUBANOWICZ Lisa wrote:
> Hi All, I have a date format of -MM-DD in MySQL and am showing it on
a PHP page.  However I want to show it as
> "2 February, 2003"
> or "2 February"
> Can someone please help me.  The date will not necessarily be todays date
(I looked at the datetime() function and the getdate() function but
couldn't work it out for these)
> Thanks for your support
> All the best
> Lisa
>
> Lisa Rubanowicz
> CNH Ireland
> Tel: +353 46 77663
> Email:  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
>
>
>
>
>

--
John Krewson
Programmer - SWORPS


--
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




Re: [PHP-DB] Date format in MySQL

2003-02-03 Thread Adam Voigt




$query = mysql_query("SELECT UNIX_TIMESTAMP(fieldname) AS date WHERE id = '1';");

$array = mysql_fetch_array($query);



$mydate = date("j F, Y",$array[date]);



Change fieldname and the where clause, and that should work.

If you want to further munipulate how it looks, just look at the

date manual page:



http://www.php.net/date



And change the first parameter to the date function.





On Mon, 2003-02-03 at 09:09, RUBANOWICZ Lisa wrote:

Hi All, I have a date format of -MM-DD in MySQL and am showing it on a PHP page.  However I want to show it as 

"2 February, 2003"

or "2 February"

Can someone please help me.  The date will not necessarily be todays date (I looked at the datetime() function and the getdate() function but couldn't work it out for these)

Thanks for your support

All the best

Lisa



Lisa Rubanowicz

CNH Ireland

Tel: +353 46 77663

Email:   [EMAIL PROTECTED]



 








-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part