search



  

Latest 5

Club Francais Korthals N79 1975
Posted: 2018-01-27 04:36:49
Invisible Google Captcha
Posted: 2017-11-10 12:51:42
Font Awesome
Posted: 2017-10-25 01:25:14
PHP Filemtime() Function - Last Updated
Posted: 2017-10-14 14:43:44

Top 5

Norwegian Kennel Club Database
Posted: 2015-10-22 10:36:06 (2018 Reads)
LOSH (Belgium) Scans Available
Posted: 2017-04-29 19:47:07 (1708 Reads)
AKC 1890
Posted: 2015-10-16 15:29:12 (1680 Reads)
ENCI - Italian Studbook
Posted: 2015-10-26 09:54:35 (1629 Reads)

Join our Newsletter

to get informed about new blog entries!
We care about your privacy - we do not send our Newsletters to all registered users, only if you subscribe HERE!
* indicates required
Choose your Category/Categories

Facebook


Ask for becoming a member of the closed group: Dog Pedigree Databases/Research

MySQL DATE_FORMAT()

SELECT CURDATE();   2017-08-31
With DATE_FORMAT() you can choose the way the date and/or time is shown in mySQL - some examples here, the complete list is shown below:
SELECT DATE_FORMAT(NOW(),'%W')   Wednesday
SELECT DATE_FORMAT(NOW(),'%W, %M %e, %Y')   Thursday, August 31, 2017
SELECT DATE_FORMAT(NOW(),'%W, %M %e, %Y @ %h:%i %p')   Thursday, August 31, 2017 @ 08:04 AM
SELECT DATE_FORMAT(NOW(),'%W, %d.%m.%Y')  Thursday, 31.08.2017
SELECT DATE_FORMAT(NOW(),'%Y')   2017
 
Moreover, you can also choose the language:
SET lc_time_names = 'fr_FR';
SELECT DATE_FORMAT(NOW(),'%W, %d.%m.%Y')       jeudi, 31.08.2017
 

Format

Description

%a

Abbreviated weekday name

%b

Abbreviated month name

%c

Month, numeric

%D

Day of month with English suffix (1st. 2nd,...)

%d

Day of month, numeric (00-31)

%e

Day of month, numeric (0-31)

%f

Microseconds

%H

Hour (00-23)

%h

Hour (01-12)

%I

Hour (01-12)

%i

Minutes, numeric (00-59)

%j

Day of year (001-366)

%k

Hour (0-23)

%l

Hour (1-12)

%M

Month name

%m

Month, numeric (00-12)

%p

AM or PM

%r

Time, 12-hour (hh:mm:ss followed by AM or PM)

%S

Seconds (00-59)

%s

Seconds (00-59)

%T

Time, 24-hour (hh:mm:ss)

%U

Week (00-53) where Sunday is the first day of week

%u

Week (00-53) where Monday is the first day of week

%V

Week (01-53) where Sunday is the first day of week, used with %X

%v

Week (01-53) where Monday is the first day of week, used with %x

%W

Weekday name

%w

Day of the week (0=Sunday, 6=Saturday)

%X

Year of the week where Sunday is the first day of week, four digits, used with %V

%x

Year of the week where Monday is the first day of week, four digits, used with %v

%Y

Year, four digits

%y

Year, two digits

 


The Pedigree Cloud: SQL 

Comments

No Comments have been Posted.

Post Comment

Please Login to Post a Comment.

Ratings

Rating is available to Members only.

Please login or register to vote.
No Ratings have been Posted.
Render time: 0.35 seconds
307,806 unique visits