1 Replies - 3713 Views - Last Post: 22 September 2011 - 02:19 PM

#1 complete  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 103
  • Joined: 12-April 07

How do I get a dattime format in C# that will look like this:

Posted 21 September 2011 - 09:24 PM

How do I get a dattime format in C# that will look like this:

2011-09-01 00:00:00:000
Is This A Good Question/Topic? 0
  • +

Replies To: How do I get a dattime format in C# that will look like this:

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,960
  • Joined: 21-March 08

Re: How do I get a dattime format in C# that will look like this:

Posted 22 September 2011 - 02:19 PM

This will show the current date with the time as you want it.

DateTime date = DateTime.Now.Date;
MessageBox.Show(date.ToString("yyyy-MM-dd HH:mm:ss:fff"));



You should take a look at Custom Date and Time Formats.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1