> --- valentin <[EMAIL PROTECTED]> wrote:
> 
> > Hello there. I need some help ... In one of my mysql
> > database fields i have stored the data. It's format
> > is Ymd, and it is printed for example: Today is
> > 2005-12-01.  What should i do in order to get
> > something like: Today is 01 Dec 2005 ? 


--- Nick Jones <[EMAIL PROTECTED]> wrote:
> You can use the strtotime() function to do what you
> want. Use something like:
> 
> <?php
> $today = date('d M Y',strtotime('2005-12-01'));
> echo "Today is $today";
> ?>
> 
> HTH
> -Nick


The PHP date functions will only work if your dates are 1 Jan 1970 or later. 
If you have earlier dates stored in your DB, like birthdates, you should use
MySQL's functions, like date_format():

  SELECT DATE_FORMAT(date_field, '%d %b %Y') AS date_field 
    FROM table_name;

The MySQL date functions work on a range from 01-01-1000 to 12-31-9999 --
enough for most applications.

James
_____


James D. Keeline
http://www.Keeline.com  http://www.Keeline.com/articles
http://Stratemeyer.org  http://www.Keeline.com/TSCollection

http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc.
Fall Semester Begins Sep 7 -- New Classes Start Every Few Weeks.


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/I258zB/QnQLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to