From: Peter Brawley Date: February 6 2012 5:56am Subject: Re: how to changing default '-' character in Datetime in MySQL? List-Archive: http://lists.mysql.com/mysql/226724 Message-Id: <4F2F6BA7.5010008@earthlink.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit On 2/5/2012 9:21 PM, Michael Dykman wrote: > You are right. It seems to have fallen into disuse since I used it last. AFAIK it has never been used. PB ----- > > At any rate, the format does not affect storage. I, like most others, > generally specify the format using the date_format function within the > queries themselves. It is more stable way to proceed anyhow; > otherwise, your code will tend to behave differently between different > servers. > > - michael > > On Sun, Feb 5, 2012 at 11:07 PM, Rajeev Prasad wrote: >> thx Michael, >> >> but the page says: >> >> * date_format >> This variable is unused. >> * datetime_format >> This variable is unused. >> >> >> ----- Original Message ----- >> From: Michael Dykman >> To: mysql mailing list >> Cc: >> Sent: Sunday, February 5, 2012 9:24 PM >> Subject: Re: how to changing default '-' character in Datetime in MySQL? >> >> To clarify, what we are discussing is the "date format". It has >> nothing to do with how it is stored. It is stored as binary data >> whatever your format is. What the date format does effect is how that >> data is formatted upon conversion to a string, assuming the >> date_format() method has not been specified in the query for more >> fine-grained control. >> >> There is a system variable 'date_format' which can be set in your >> mysql.cnf to affect the entire system; it has been around since >> version 3.23. Alternatively, it may be specified on a >> session-by-session basis if you prefer. Refer to the documentation >> page below for details on manipulating system variables either >> globally or on a per-session basis. >> >> http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html >> >> - michael dykman >> >> 2012/2/5 Halász Sándor: >>>>>>> 2012/02/04 19:13 -0800, Rajeev Prasad>>>> >>> MySQL datetime field type keeps data as: YYYY-MM-DD HH:mm:SS is there a way to store this data as: YYYY/MM/DD HH:mm:SS or going much further (optionally) can we store as: MM/DD/YYYY HH:mm:SS ? if not then whats the best way to reformat the cell value from YYYY-MM-DD to MM/DD/YYY >>> <<<<<<<< >>> That is MySQL s string format, and that is what you get. That said, there is a function DATE_FORMAT (look it up) that lets one change its look. Its format argument is quite ugly. >>> >>> >>> -- >>> MySQL General Mailing List >>> For list archives: http://lists.mysql.com/mysql >>> To unsubscribe: http://lists.mysql.com/mysql >>> >> >> >> -- >> - michael dykman >> - mdykman@stripped >> >> May the Source be with you. >> >> -- >> MySQL General Mailing List >> For list archives: http://lists.mysql.com/mysql >> To unsubscribe: http://lists.mysql.com/mysql > >