由网友(中锋男神)分享简介:我有一个对象 2011年2月19日上午12点00分零零秒。我想这个对象转换为 19/2/2011 。请给我的最可能的答案日期时间转换为字符串格式。解决方案 DateTime的DT = DateTime.ParseExact(yourObject.ToString(),MM / DD / YYYY HH:MM:SS...
我有一个对象 2011年2月19日上午12点00分零零秒
。我想这个对象转换为 19/2/2011
。请给我的最可能的答案
日期时间转换为字符串格式。
解决方案 DateTime的DT = DateTime.ParseExact(yourObject.ToString(),MM / DD / YYYY HH:MM:SS TT,CultureInfo.InvariantCulture);
字符串s = dt.ToString(DD / M / YYYY);
i have an object 2/19/2011 12:00:00 AM
. i want to convert this object to 19/2/2011
. please give me the most possible answers
convert datetime to string format.
解决方案DateTime dt = DateTime.ParseExact(yourObject.ToString(), "MM/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
string s = dt.ToString("dd/M/yyyy");
相关推荐
最新文章