LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-24-2007, 06:52 AM   #1
sidboyce
Member
 
Registered: Jan 2003
Location: Halesowen, West Midlands, UK
Distribution: SuSE 10.0/Mandriva 2006/gentoo
Posts: 89

Rep: Reputation: 15
How to change mysql date format


My dates in mysql are the ISO standard 2007-10-24 in queries and I would like to change to 24-10-2007 format.
Help appreciated, search didn't throw up anything useful.
 
Old 10-24-2007, 07:25 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
You may want to take a look at http://dev.mysql.com/doc/refman/5.0/...-overview.html and http://dev.mysql.com/doc/refman/5.0/en/datetime.html. At the bottom of the first reference is an example:
Quote:
To extract a timestamp in a human-readable format, use:

SELECT DATE_FORMAT(timestamp,'%l:%i:%s %p on %M %D, %Y') as ...
FROM ...

This returns:
9:15:37 PM on April 22nd, 2005

You can change the formatting or ordering in the single quotes as necessary. A complete list of the specifiers (like '%Y') are listed if you look up DATE_FORMAT.
Information about the DATE_FORMAT function is found at http://dev.mysql.com/doc/refman/5.0/...on_date-format

Hope this helps some.
 
  


Reply



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 On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the format of date command. UltraSoul Solaris / OpenSolaris 7 05-16-2007 10:05 AM
How to change Evolution date format? haertig Linux - Software 1 10-23-2006 11:34 AM
REDHAT: Change Date Format from MM/DD/YY to DD/MM/YY? gtjmn308 Linux - Software 1 04-12-2006 08:02 AM
MySQL date format mnauta Linux - General 2 05-13-2004 06:20 PM
All I want to do is change the date format... Slycordinator Linux - General 5 12-11-2003 01:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration