www.fltk.net > 写一个js函数,能求取某个日期是星期几

写一个js函数,能求取某个日期是星期几

获取2014年5月1号是星期几 var date = new Date(2014,4,1); alert(date.getDay());

weekday[0]="Sunday" weekday[1]="Monday" weekday[2]="Tuesday" weekday[3]="Wednesday" weekday[4]="Thursday" weekday[5]="Friday" weekday[6]="Saturday"

var today = new Date();var nextDay = new Date(today);nextDay.setDate(today.getDate()+11);alert(nextDay);

function brthDate(m,d){var today=new Date();var year=today.getFullYear();var month=today.getMonth();var date=today.getDate();var byear=year;//计算今年生日是否过完,过完就算明年生日了if(m

function getTime() { var now_Date = new Date(); var nowYear; var nowMonth; var nowDay; var nowdate; var nowHourse; var nowMinutes; var nowSeconds; nowYear = now_Date.getYear(); nowMonth = now_Date.getMonth() + 1; nowDay = now_...

var date1 = new Date('2013/04/02 18:00')var date2 = new Date('2013/04/02 19:22:21')var s1 = date1.getTime(),s2 = date2.getTime();var total = (s2 - s1)/1000;var day = parseInt(total / (24*60*60));//计算整数天数var afterDay = tot...

sql中这样取,select DateDiff("dd",joindatetime,getdate()) from db 那么在c#中呢 //C#中使用TimeSpan计算两个时间的差值 //可以反加两个日期之间任何一个时间单位。 private string DateDiff(DateTime DateTime1, DateTime DateTime2) {string...

这是比较两个日期的时间是否相等, 0-是相等 1-第一个参数的日期大于第二个 2-小于第二个

function factorial(n){ return n > 1 ? n * factorial(n-1) : 1;}factorial(5);//120以上函数可以求简单的n的阶乘 由于使用的是原生的乘法,所以计算范围有限 主要使用了递归的方式进行计算,是求阶乘的常用方法之一

menuonload = function () { var lis = document.querySelectorAll ("li"); for ( var i = 0; i < lis.length; i++) { lis[i].onmousedown = function (e) { start (this); }; lis[i].onmouseup = function (e) { stop (this); } } } var start ...

网站地图

All rights reserved Powered by www.fltk.net

copyright ©right 2010-2021。
www.fltk.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com