why is month format different ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

DateTime now = DateTime.Now; // { for Feb 9, 2006 }
string test = now.ToString("mm");
And I get 42 ?? what does this mean ?

For
string test = now.ToString("yyyydd");
test = "200609" ..
but
string test = now.ToString("yyyymmdd");
test = "20064209" .. I was expecting 20060209
 
andrewcw said:
DateTime now = DateTime.Now; // { for Feb 9, 2006 }
string test = now.ToString("mm");
And I get 42 ?? what does this mean ?

For
string test = now.ToString("yyyydd");
test = "200609" ..
but
string test = now.ToString("yyyymmdd");
test = "20064209" .. I was expecting 20060209

You are getting the MINUTES portion of the date/time.

ToString expects mm for Minutes and MM for Month :)

Mythran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top