日期:2014-05-16 浏览次数:20311 次
<html> <head> <title></title> <script type="text/javascript"> function toDate(uYear, uMonth, uDay) { var arr = "日一二三四五六".split(""); with(document.all) { var vYear = parseInt(uYear, 10); var vMonth = parseInt(uMonth, 10); var vDay = parseInt(uDay, 10); } var date = "星期"+arr[new Date(vYear,vMonth-1,vDay).getDay()]; alert(date); return date; } window.onload = function() { var dateStr = "2010-07-01"; var arr = dateStr.split("-"); toDate(arr[0], arr[1], arr[2]); } </script> </head> <body> </body> </html>