开发者

SQL Server date_format

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');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜