--- Patrick Bierans <[EMAIL PROTECTED]> wrote:

> > I have a table where I save the date. The format is "2005-07-19" in my 
> > table. I want to change the format to "19-07-2005" when on the screen for 
> > the user. What is the best way to reformat the date?
> 
> You may go with DATE_FORMAT(date,format) - lookup the manual for date and 
> time functions: 
> http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html
> 
> or you can use php do the job with date() http://php.net/date
> 
> HTH 

I wouldn't use the date functions in PHP because most operating systems do not
give the proper negative numbers for date/times before the epoch date for the
OS.  Hence, any date before midnight 1 Jan 1970 appears to be 31 Dec 1969 at 1
second before midnight on a Unix/Linux system.

MySQL's date format allows dates from the year 1000 to 9999--surely enough for
most people's calendars.

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.
Summer Semester Begins Jun 20 -- New Classes Start Every Few Weeks.


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