如何以此格式获取当前日期(例如:2012年8月15日) [英] How to get the current date in this format (eg:15-August-2012)

查看:67
本文介绍了如何以此格式获取当前日期(例如:2012年8月15日)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述







如何以此格式获取当前日期(例如:2012年8月15日)

Hi,


How to get the current date in this format (eg:15-August-2012)

推荐答案

嗨prakash,



参考参考



Sql Date Formates [ ^ ]
Hi prakash,

see reference

Sql Date Formates[^]


尝试以下查询

Try the following Query
引用:

SELECT convert(varchar(12),getdate(),106)

SELECT convert(varchar(12), getdate(), 106)


SELECT CAST(DAY(GETDATE()) AS VARCHAR(2)) + ' ' + DATENAME(MM, GETDATE()) + ' ' + CAST(YEAR(GETDATE()) AS VARCHAR(4)) AS [DD Month YYYY]





尝试此查询。会根据您的需要返回...



try this query.it will return according to ur need...


这篇关于如何以此格式获取当前日期(例如:2012年8月15日)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆