Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old September 1st, 2008, 09:31 PM
Newbie
 
Join Date: Aug 2008
Posts: 12
Default Mysql Date Format

Can anyone plz advice, how to change mysql date format to (d-m-Y) permanently
which will affect all the databases in the mysql server. i.e, i want to change the date format in one place which will affect all the database's date format automaticly?

Is there any way out? Or code?
Reply
  #2  
Old September 2nd, 2008, 12:06 AM
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Age: 22
Posts: 2,760
Default

Hi.

MySQL will always display Date values in the "YYYY-MM-DD" format.
You can't change that, and even if you could, it would be a horrible idea.

You can, however, use the DATE_FORMAT function to re-format the date before using it.

But I wouldn't do that. You really shouldn't alter the data your database returns. It is far more consistent to have MySQL return data in it's default format and have your application (like say PHP code) format the data before using it.
Reply
  #3  
Old September 2nd, 2008, 09:49 PM
Newbie
 
Join Date: Aug 2008
Posts: 12
Default

Quote:
Originally Posted by Atli
Hi.

MySQL will always display Date values in the "YYYY-MM-DD" format.
You can't change that, and even if you could, it would be a horrible idea.

You can, however, use the DATE_FORMAT function to re-format the date before using it.

But I wouldn't do that. You really shouldn't alter the data your database returns. It is far more consistent to have MySQL return data in it's default format and have your application (like say PHP code) format the data before using it.
Thanks Atli,

I get it.
Reply
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles