Re: Datetime format in MySQL
On Thursday 22 April 2004 12:56, [EMAIL PROTECTED] might have typed: Hi All, Can you specify what format to use for the datetime column eg. in oracle you can say I wanna use DD-MMM- HH:MM:SS and so on? If you read the manual, you will see that the column is formatted in one way, and one way only. You use modifiers on the select statement to get the format you want. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Datetime format in MySQL
[EMAIL PROTECTED] wrote: Hi All, Can you specify what format to use for the datetime column eg. in oracle you can say I wanna use DD-MMM- HH:MM:SS and so on? No. You can use DATE_FORMAT() function to format date values when you retrieve data: http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Datetime format in MySQL
You can specify the date (Datetime or Timestamp) format when creating table as follows: Type=Format - DATETIME = -MM-DD HH:MM:SS DATE = -MM-DD TIME = HH:MM:SS YEAR = TIMESTAMP --- TIMESTAMP(14) = MMDDHHMMSS TIMESTAMP(12) = MMDDHHMM TIMESTAMP(10) = MMDDHH TIMESTAMP(8) = MMDD TIMESTAMP(6) = MM TIMESTAMP(4) = TIMESTAMP(2) = YY So you can say something like this: Create table Use (user char(30), LoginTime DATE); # This will set LoginTime as 2004-04-22 Create table Use (user char(30), LoginTime TIMESTAMP(12)); # This will set LoginTime as 200404221810 HTH Babs || -Original Message- || From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] || Sent: Thursday, April 22, 2004 1:56 PM || To: [EMAIL PROTECTED] || Subject: Datetime format in MySQL || || Hi All, || Can you specify what format to use for the datetime column eg. || in oracle you can say I wanna use DD-MMM- HH:MM:SS and so on? || || Regards, || Amit || || || -- || MySQL General Mailing List || For list archives: http://lists.mysql.com/mysql || To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]