Bug #13428 DATE_FORMAT function
Submitted: 23 Sep 2005 14:25 Modified: 23 Sep 2005 14:40
Reporter: andrew xie Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.12 beta OS:sun solaris9
Assigned to: MySQL Verification Team CPU Architecture:Any

[23 Sep 2005 14:25] andrew xie
Description:
SELECT DATE_FORMAT(now(), '%Y%m%d%h%I');

when I run query at: 9:55 am
return result: 200509230909

when I run query at: 10:08am  
return result: 200509231010
in another word, it always return same hours and minutes.

How to repeat:
SELECT DATE_FORMAT(now(), '%Y%m%d%h%I');

try to run this query at diferrent hours.
[23 Sep 2005 14:40] MySQL Verification Team
Please see:

http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html

about specifiers may be used in the format string %I and %i.

miguel@hegel:~/dbs/5.0> bin/mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.14-rc-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SELECT DATE_FORMAT(now(), '%Y%m%d%h%I');
+----------------------------------+
| DATE_FORMAT(now(), '%Y%m%d%h%I') |
+----------------------------------+
| 200509231111                     |
+----------------------------------+
1 row in set (0.03 sec)

mysql> SELECT DATE_FORMAT(now(), '%Y%m%d%h%i');
+----------------------------------+
| DATE_FORMAT(now(), '%Y%m%d%h%i') |
+----------------------------------+
| 200509231135                     |
+----------------------------------+
1 row in set (0.00 sec)

mysql>