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 ;)Answer1:
Assuming .NET (from the datetime tag):
Since you never told us the language, <a href="http://en.allexperts.com/q/Cobol-1443/2008/6/COBOL-5.htm" rel="nofollow">here</a>'s a discussion on how to do it in COBOL.Answer3:
In C, you would use a combination of the
<a href="http://linux.die.net/man/3/localtime" rel="nofollow">localtime()</a> and
<a href="http://linux.die.net/man/3/strftime" rel="nofollow">strftime()</a> functions. They should handle internationalization more or less automatically, if your application is set up for it.
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.