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 ;)
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 ;)
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.
Assuming .NET (from the datetime tag):
DateTime.Parse("2009-10-02").ToString("D", CultureInfo.CreateSpecificCulture("en"));
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.