473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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?
Sep 1 '08 #1
2 5623
Atli
5,058 Expert 4TB
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.
Sep 1 '08 #2
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.
Sep 2 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Neil | last post by:
Hi, I hope this question isn't too far off topic....I'm almost at my wits end trying to figure this out. I have a Mysql database and I wish to automate the backup of the database because I...
1
by: Bruce | last post by:
I have an application where I would like to be able to allow the user to specify the date format used throughout the program (for internationalization). Then, on a date entry field, I can...
4
by: RT | last post by:
If anyone can help that would be great. Iım trying to format a timestamp from my MySQL table (sessions) Hereıs the code Iım using: <?php echo date('D,n-j-y h:i:s...
1
by: Neal | last post by:
I have a MySQL table with a datetime field that stamps the time the user submitted the form. It works and looks like this: $sql = "INSERT INTO table VALUES(....now())"; On another php page to...
2
by: Phil Nospam | last post by:
Hello all, I was browsing through the reference manual on the mysql.com web site and found the following code examples for some date/time functions: mysql> SELECT STR_TO_DATE('00/00/0000',...
2
by: Paul | last post by:
I am trying to insert a date into a mysql table but everytime I attempt it the date field is always empty. The field is of Date type and the date in code is in European format dd/mm/yyyy. ...
4
by: Dan Lewis | last post by:
I've imported a ms access database into a table in a mysql database. The access database contains a field that holds date/time values in 'general date' format. These all show up at 01/01/1970 in...
1
by: jimmy | last post by:
I'm trying to insert a date into a MySQL date column. The string i am trying to insert takes the following format: 2007-02-23 which corresponds to the date format that MySQL uses which is...
12
by: mantrid | last post by:
Hello Can anyone point me in the right direction for the way to read a text file a line at a time and separate the fields on that line and use them as data in an INSERT to add a record to a mysql...
1
by: paulq182 | last post by:
PLEASE HELP ME WITH MY CODE?? import java.sql.*; import java.io.*; class min_filmdb_rel_mysql { public static void main (String args ) throws SQLException, IOException {
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.