2 function datetoday(day, month, year)
7 dayofweek = (23 * month / 9 + day + 4 + year + z / 4 - z / 100 + z / 400)
8 if(month >= 3) dayofweek -= 2
9 dayofweek = dayofweek % 7
13 local values, day, month, year, dow, months, days
15 "january", "february", "march",
16 "april", "may", "june", "july",
17 "august", "september", "october",
18 "november", "december"]
21 "Monday", "Tuesday", "Wednesday", "Thursday",
22 "Friday", "Saturday", "Sunday"]
25 print("Enter the date as 'dd mm yyyy' (without quotes): ")
26 values = io.stdin.readline().split(" ")
27 day = values[0].tointeger()
28 month = values[1].tointeger()
29 year = values[2].tointeger()
30 dow = days[datetoday(day, month, year) - 1]
31 println("The %d' of %s, %d is a %s".fmt(day, months[month-1], year, dow))