date string needed

  • Thread starter Thread starter rodchar
  • Start date Start date
R

rodchar

hey all,

i'd like a string of today's date in the following format:
mmddyy

and here's how i did it:
String directoryName = DateTime.Now.Month.ToString() +
DateTime.Now.Day.ToString() + DateTime.Now.Year.ToString().Substring(2);

is there an easier way?

thanks,
rodchar
 
Note that MM differs from mm. MM = month, mm = minute. Someone where I
work hard coded time formats rather than using the system format (no idea
why), but to make things worse he encoded them all hh:ss - so we had what
looked like end times that were before start times :-)
 

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

Similar Threads

Date Format 2
format string from 8 to 08 for August. 7
date formatting 2
lightest collection possible 6
delimited string test 3
search my String[] 6
Executing a var within an aspx .inc file? 4
enum basics 7

Back
Top