tags:

views:

109

answers:

4

Hi

I would like to convert a yyyy-mm-dd to something like this:

"Saturday, 2 October 2009"

I would like also to have the option to modify the language both day of the week and month (make it customizable)

thanks in advance ;)

A: 

Convert the date into an integer, representing the days since a specific date, then add a number and apply the modulus operator with the operand 7. That will give you a number 0-6 that represents the day of week.

However, most languages have this functionality built-in.

Lars D
+5  A: 

Since you never told us the language, here's a discussion on how to do it in COBOL.

luvieere
+2  A: 

Assuming .NET (from the datetime tag):

DateTime.Parse("2009-10-02").ToString("D", CultureInfo.CreateSpecificCulture("en"));
Mehmet Ergut
+1  A: 

In C, you would use a combination of the localtime() and strftime() functions. They should handle internationalization more or less automatically, if your application is set up for it.

unwind