Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
379 views
in Technique[技术] by (71.8m points)

c# - C#DateTime为“ YYYYMMDDHHMMSS”格式(C# DateTime to “YYYYMMDDHHMMSS” format)

I want to convert a C# DateTime to "YYYYMMDDHHMMSS" format.

(我想将C#日期时间转换为“ YYYYMMDDHHMMSS”格式。)

But I don't find a built in method to get this format?

(但是我没有找到获取这种格式的内置方法吗?)

Any comments?

(任何意见?)

  ask by SARAVAN translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
DateTime.Now.ToString("yyyyMMddHHmmss"); // case sensitive

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...