1 #!/usr/bin/env python2 #Encoding:utf-83 4 #Coding=utf-85 6Date_star={7 '1':'Monday',8 '2':'Tuesday',9 '3':'Wednesday',Ten '4':'Thursday', One '5':'Friday', A '6':'Saturday', - '0':'Sunday', - } the - defCaile (*args): -Year,month,day =args -month =Int (month) +Day =Int (day) -year_one,year_two = Int (str (year) [: 2]), int (year) [2:]) + ifmonth = = 1ormonth = = 2: A return(Year_two-1 + (year_two-1)//4 + Year_one//4-2*year_one + 26* (month+12+1)//10 + day-1)%7 at return(Year_two + YEAR_TWO//4 + year_one//4-2*year_one + 26* (month+1)//10 + day-1)%7 - -Date = Raw_input ('Enter the number of years in the month, separated by spaces >>>>:' ) - -Year = Date.split (' ') [0] -month = Date.split (' ') [1] inDay = Date.split (' ') [2] -Year,month,day = Date.split (' ') to Print "%s\n"%date,date_star['%s'%caile (Year,month,day)]
Python date Conversion Week Caille formula