William Thompson

William Thompson

  • 1.6k
  • 157
  • 300k

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

Sep 22 2011 2:55 AM

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

2011-09-01 00:00:00:000
This works
                DateTime saveNow = DateTime.Now;

                string test = String.Format("{0:yyyy-MM-01 00:00:00:000}", saveNow);

Now I want to know this.  How would I subtract one month from the current month?

It T-SQL it would look like this
[IMG]http://i67.photobucket.com/albums/h292/Athono/THIS-1.png[/IMG]
How would it be done in C#?


trying the addmonth method with a negative one did not work
[IMG]http://i67.photobucket.com/albums/h292/Athono/thisdidnotwork.png[/IMG]


Answers (3)