如何转换日期格式? [英] How To Convert Date Format?

查看:83
本文介绍了如何转换日期格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何转换此日期格式20140415(YYMMDD),格式低于日期格式

四月'14。

这个



Thannx .....

How to Convert this date format "20140415"(YYMMDD) in below date format
April'14.
This

Thannx.....

推荐答案

SELECT CONVERT(varchar, CONVERT(date, '20140415'), 106)





这将为您提供'2014年4月15日'。



您可以弄清楚如何将其转换为4月14日。



This will give you '15 Apr 2014'.

You can figure out how to convert that to Apr'14.






选中此项... SQL服务器函数,有助于将日期和时间值转换为字符串文字和其他日期和时间格式。 [ ^ ]



希望这会对你有所帮助。



干杯
Hi,

Check this...SQL Server Functions that helps to convert date and time values to and from string literals and other date and time formats.[^]

Hope this will help you.

Cheers


解决方案:

Solution :
DateTime dates = DateTime.ParseExact("20140415", "yyyyMMdd", CultureInfo.InvariantCulture)


这篇关于如何转换日期格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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