字符串转换为日期时间使用C# [英] Convert string to datetime Using C#

查看:466
本文介绍了字符串转换为日期时间使用C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何转换成字符串像20100102到日期时间在DD / MM / YYYY的甲?


解决方案

  VAR userdateformat = DateTime.ParseExact(20101020,年月日,System.Globalization.CultureInfo.CurrentCulture);

修改的要修改。

How can i convert String like 20100102 into datetime in a formate of dd/MM/yyyy?

解决方案

var userdateformat = DateTime.ParseExact("20101020", "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture);

Modify as you want to modify.

这篇关于字符串转换为日期时间使用C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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