Bug #68062 TIME_TO_SEC() doesn't support fractional seconds

Submitted: 9 Jan 2013 21:35
Reporter: Todd Farmer (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Data Types Severity:S3 (Non-critical)
Version:5.6.8-rc OS:Any
Assigned to: CPU Architecture:Any

[9 Jan 2013 21:35] Todd Farmer
Description:
mysql> SELECT TIME_TO_SEC(SEC_TO_TIME(2378.7));
+----------------------------------+
| TIME_TO_SEC(SEC_TO_TIME(2378.7)) |
+----------------------------------+
|                             2378 |
+----------------------------------+
1 row in set (0.02 sec)

SEC_TO_TIME(), however, does:

mysql> SELECT SEC_TO_TIME(2378.7);
+---------------------+
| SEC_TO_TIME(2378.7) |
+---------------------+
| 00:39:38.7          |
+---------------------+
1 row in set (0.00 sec)

How to repeat:
See above

Suggested fix:
Add optional second argument to specify fractional second precision.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.048 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.