471,337 Members | 1,034 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Formatting datetime

Joe
I need to format the DateTime into such format "yyyymmdd HH:mm"

how do you do that?

Feb 4 '06 #1
3 1517
DateTime myDateTime = DateTime.Now;
Console.WriteLine(myDateTime.ToString("yyyymmdd HH:mm");

as per

http://msdn.microsoft.com/library/de...ringtopic3.asp

Feb 4 '06 #2
Joe wrote:
I need to format the DateTime into such format "yyyymmdd HH:mm"

how do you do that?


Console.WriteLine(String.Format("{0:yyyyMMdd HH:mm}", DateTime.Now))
Feb 4 '06 #3
Check out: http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=181

Sonu Kapoor [MVP]
---
Posted via www.DotNetSlackers.com
Feb 5 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Gerrit Holl | last post: by
1 post views Thread by McGiv | last post: by
2 posts views Thread by Mark | last post: by
4 posts views Thread by Ken Wigle | last post: by
7 posts views Thread by sherifffruitfly | last post: by
1 post views Thread by Untitled | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.