What is the function DATE_FORMAT in SQL Server
I want to change my now date to d-m-Y h:i
开发者_如何学JAVAHow to do
I'm afraid that, in SQL Server, giving format to a date is not as simple as it should. You end up doing stuff like:
CONVERT(VARCHAR, CURRENT_TIMESTAMP, 103) + ' ' + CONVERT(VARCHAR(8), CURRENT_TIMESTAMP, 114)
You can find the reference at http://msdn.microsoft.com/es-es/library/ms187928.aspx
The MySQL documentation for date_format is pretty good.
select date_format(NOW(), '%d-%m-%Y %H:%i');
精彩评论