Bug #29915 | Minor documentation fix | ||
---|---|---|---|
Submitted: | 19 Jul 2007 21:33 | Modified: | 20 Jul 2007 0:24 |
Reporter: | Sheeri Cabral (Candidate Quality Contributor) | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.1, 5.0, and the 3,4,4.1 docs | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | date, date format |
[19 Jul 2007 21:33]
Sheeri Cabral
[19 Jul 2007 21:50]
Paul DuBois
mysql> select date_format(now(),'%h %I'); +----------------------------+ | date_format(now(),'%h %I') | +----------------------------+ | 04 04 | +----------------------------+ Looks like two digits to me.
[19 Jul 2007 23:06]
Sheeri Cabral
Very odd... I was doing this: mysql> select date(str_to_date('Sunday, July 15, 2007 2:10 PM','%W, %M %d, %Y %h:%i %p')); +-----------------------------------------------------------------------------+ | date(str_to_date('Sunday, July 15, 2007 2:10 PM','%W, %M %d, %Y %h:%i %p')) | +-----------------------------------------------------------------------------+ | 2007-07-15 | +-----------------------------------------------------------------------------+ And was getting a NULL value when I used %I instead of %h. Of course I can't replicate it now..... but then how would one get the 12-hour-format hour without leading zeros?
[19 Jul 2007 23:20]
Jim Winstead
%l (lowercase L) is the format specifier for 12-digit hour with no leading 0, according to the docs.