计算你的出生日在星期几。有时间有点意思
<html>
<head><script LANGUAGE="JavaScript">
<!-- //Author: Michael Gudaitis //e-mail: jojoo@jojoo.net //You may use this script free of charge so long as //this copyright information stays intact. //copyright 1998
function cala_day(form) { var nSwitch = 0 var nMonth = parseInt(form.month.value) var nDay = parseInt(form.day.value) var nYear = parseInt(form.year.value) if(!(nYear % 4) && (nMonth > 2)) { nSwitch = 1 }
var nDayOfWeek = cala_weekday(nMonth, nDay, nYear) if(nSwitch) { nDayOfWeek++ nSwitch = 0 } day_display(form, nDayOfWeek) }
function cala_weekday( x_nMonth, x_nDay, x_nYear) {
if(x_nMonth >= 3){ x_nMonth -= 2 } else { x_nMonth += 10 }
if( (x_nMonth == 11) || (x_nMonth == 12) ){ x_nYear-- }
var nCentNum = parseInt(x_nYear / 100) var nDYearNum = x_nYear % 100 var nPart1 = parseInt(2.6 * x_nMonth - .2) var nZeller = (parseInt(nPart1 + x_nDay + nDYearNum + (nDYearNum / 4) + (nCentNum / 4) - 2 * nCentNum)) % 7 if(nZeller < 0){ nZeller += 7 }
|