Total members 11653 |It is currently Thu Jul 27, 2017 5:42 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Using date_format in mysql function you can change the date format for dates data selected from database. For example imagine that you have a table “Department” and you want to change date format for one of selected field:

Code:

SELECT date_format 
EntryDate'%m/%d/%Y %T' ) as entryDate FROM Department




Here Department is the table name and EntryDate is the field name. The formatting is done like this 'm/%d/%Y %T’ is used. You can change the date formats to many ones here is some of them:
Code:
'%W %D %M %Y %T'   Wednesday 4th June 2011 11:46:51
'%a %b %e %Y %H:%i'   Wed June 4 2011 11:46
'%m/%d/%Y %T'   06/04/2011 11:46:51
'%d/%m/%Y'   04/06/2011





Author:
Mastermind
User avatar Posts: 2707
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Formatting dates in mysql
 DYNAMIC DATES IN MYSQL     -  
 formatting string in c++     -  
 date formatting in Java     -  
 find the difference between dates in asp.net     -  
 Comparing Dates in Java     -  
 Get Difference in days between two dates as a number     -  
 Formatting a Date with date()     -  
 need help in mysql     -  
 connect to MYSQL from ASP     -  
 need help in jdbc with mysql     -  










Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team