c# build String

Need to populate a variable dynamically so that it...

1.  Shows PREVIOUS month with 3 letters
2.  And year associated with previous month  

Example - expected format as of Feb, 2011:
Jan2011.zip

Thank you kindly!
LVL 16
carsRSTAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
DateTime t = DateTime.Today.AddMonths(-1);
string t = t.ToString("MMMyyyy") + ".zip";
0
 
carsRSTAuthor Commented:
And in January of this year the format would be...

Dec2011.zip
0
 
carsRSTAuthor Commented:
excellent.  Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.