on 2017 Mar 30 12:35 PM
According to the documentation for DATEFORMAT / timestamp_format, MM represents month.
However, consider the output of:
SELECT DATEFORMAT('2017-12-30 12:34:56.789','YYYY:MM:DD:HH:NN:SS:SSS')
The expected value would be:
'2017:12:30:12:34:56:789'
However, the function returns:
'2017:34:30:12:34:56:789'
It appears that the database server (dbsrv12 version 17.0.4.2053, also tested on the last 12.0.1 EBF with same result) considers MM to be an alias for NN if preceded by a colon. That is not the documented behavior. I recent ran into an application that required all date parts to be separated by colons.
Of course, the workaround is YEAR(...)||':'||MONTH(...)||... but if the existing behavior is by design, should the documentation not reflect that? Or is this a bug? I presume that since the behavior seems to be specific to colons, that it is intentional.
This is documented behavior under the TIMESTAMP_FORMAT DCX article
"MM Two-digit month, or two-digit minutes if following a colon (as in HH:MM) "
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.