Day of the Week

Add a reply

Posted by blake8086 613 days ago:
Given a date in dd-mm-yyyy form in the range (January 1, 1753)-(December 31, 2399), print what day of the week it was or will be: sunday, monday, tuesday, wednesday, thursday, friday, saturday

Example input:
1-1-1753

Example output:
monday

Example input:
1-1-2000

Example output:
saturday

Example input:
12-31-2399

Example output:
friday
Posted by flagitious 613 days ago:
We have agreed to change it from print monday, tuesday, etc, to: mo, tu, etc (first 2 letters of the weekday in lower case). This will make it so using a languages builtin Time function will be of less use.

Note, languages without builtin time functions shouldn't be at much of a disadvantage if any because those functions do not accept times in as large as range as the problem specifications.

Also note, original input said dd-mm-yyyy, but he meant d-m-y, where day and month will be 2 long unless 1-9.
Posted by pbx 611 days ago:
Isn't this just a subset of the Calendars challenge?

Add a reply