DateTime (Month) conversion

M

Miguel Gómez

Hi, Guys!

Does any body can tell me if there is any function, method or property
inside the framework 2.0 which can convert the number of the month to its
corresponding name?
Something like this:

str name= fn(3);

so that fn(3) returns "march", fn(4) returns "april", etc

Thank you very much.
 
H

Hans Kesting

After serious thinking Miguel Gómez wrote :
Hi, Guys!

Does any body can tell me if there is any function, method or property inside
the framework 2.0 which can convert the number of the month to its
corresponding name?
Something like this:

str name= fn(3);

so that fn(3) returns "march", fn(4) returns "april", etc

Thank you very much.

DateTime dt = new DateTime(2009, 3, 1);
string monthname = dt.ToString("MMMM", new
System.Globalization.CultureInfo("en-GB")));

Adjust the culture (én-GB'in the example) to your needs.

Hans Kesting
 
M

Miguel Gómez

Thank you very much, Hans.


Hans Kesting said:
After serious thinking Miguel Gómez wrote :

DateTime dt = new DateTime(2009, 3, 1);
string monthname = dt.ToString("MMMM", new
System.Globalization.CultureInfo("en-GB")));

Adjust the culture (én-GB'in the example) to your needs.

Hans Kesting
 

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

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top