Solved

c# build String

Posted on 2011-03-02
3
463 Views
Last Modified: 2012-05-11
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!
0
Comment
Question by:carsRST
  • 2
3 Comments
 
LVL 16

Author Comment

by:carsRST
ID: 35020570
And in January of this year the format would be...

Dec2011.zip
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 35020593
DateTime t = DateTime.Today.AddMonths(-1);
string t = t.ToString("MMMyyyy") + ".zip";
0
 
LVL 16

Author Closing Comment

by:carsRST
ID: 35020660
excellent.  Thanks
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question