使用c代码进行日期转换 [英] date conversion using c sharp code

查看:65
本文介绍了使用c代码进行日期转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将这个日期格式dd-MMM-yyyy转换为dd-MMM-yy,我怎么能用



C锐码来做到这一点。 />


ex。 01-Jul-2012转换为01-Jul-12



我的问题是这样的





我有一个字段名称为Date Created,在此字段下有很多日期



ex。



01-Jul-2012这些日期必须转换为01-Jul-12

18-Dec-2011 18-Dec-11

27- 2011年5月27日 - 5月11日

05-Jun-2012 05-Jun-12





感谢您对我的问题的任何输入。

I like to convert this date format dd-MMM-yyyy to dd-MMM-yy,how could I do this using

C sharp code.

ex. 01-Jul-2012 converted to 01-Jul-12

My problem is like this


I a have a field name to Date Created, under this field are many dates

ex.

01-Jul-2012 these date must converted to 01-Jul-12
18-Dec-2011 18-Dec-11
27-May-2011 27-May-11
05-Jun-2012 05-Jun-12


Thank you for any input on my question.

推荐答案

查看这行代码。它用于转换当前日期格式。

look at this line of code.it is for converting current date format.
System.DateTime.Now.ToShortDateString("dd-MM-yy");



你可以转换


either u can convert

mydatestring.ToShortDateString("dd-MM-yy");


这篇关于使用c代码进行日期转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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