最好是不管时间格式是什么样的,只要两个时间格式正确,就能判断他们大小的方法????
解决方案 »
- 注册时有关电子邮箱的问题
- 求个主从显示的SQL语句/存储过程
- ASP.net程序中预览是条形码到了Adobe Reader预览打印时不是怎么办?
- 一个关于记数的问题~~在线等
- 散分,宝宝的生日快到了。顺便求一支生日歌,THX!
- 用户 'sa,pwd=' 登录失败?按照树上的标准例子打的?SQLserver配置中应注意什么问题呢?
- 哪位大哥能告诉我在哪能下载到ASP.ET1。1
- request 问题. 急!!!
- 树型目录树的一个小问题dv.Table = ds.Tables("tree") 报错!!
- 散 200 分,C# 及 ASP.NET 我是不是选错了?请问 SharpZip 怎么用?
- Assembly!!!朋友都来看看啊!
- 如何构造一个request("")过去 asp 验证页面
var t2="2009/10/9";
if(Date.parse(new Date(时间1))>Date.parse(new Date(时间1)) )
alert();
else
alert();
function TimeCom(Value)
{
var newCom = new Date(value);
this.year = newCom.getYear();
this.month = newCom.getMonth()+1;
this.day = newCom.getDate();
this.hour = newCom.getHours();
this.minute = newCom.getMinutes();
this.second = newCom.getSeconds();
this.msecond = newCom.getMilliseconds();
this.week = newCom.getDay();
}
//对日期相减,并计算得出结果,返回两个时间的相差秒数
function DateDiff(begindate,enddate)
{
var TimeCom1 = new TimeCom(begindate);
var TimeCom2 = new TimeCom(enddate);
var result;
//转换为标准的格林尼治时间进行计算
return Math.round((Date.UTC(TimeCom1.year,TimeCom1.month-
1,TimeCom1.day,TimeCom1.hour,TimeCom1.minute,TimeCom1.second)-Date.UTC(TimeCom2.year,TimeCom2.month-
1,TimeCom2.day,TimeCom2.hour,TimeCom2.minute,TimeCom2.second))/1000);
}
//通过DateDiff返回的结果计算显示需要的数据
function TimeGet(Value)
{
var secondTotal=parseInt(Value)
this.day=Math.round(secondTotal/(60*60*24));
secondTotal=secondTotal%(60*60*24);
this.hour=Math.round(secondTotal/(60*60));
secondTotal=secondTotal%(60*60);
this.minute=Math.round(secondTotal/(60));
secondTotal=secondTotal%(60);
this.second=secondTotal;
} 本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/tkascor/archive/2009/09/10/4538556.aspx
function tijiao()
{
var t=document.getElementById("TextBox1").value;
var t2=document.getElementById("TextBox2").value; if(Date.parse(new Date(t))>Date.parse(new Date(t2)))
{
alert("停牌时间必须在比赛时间之前!");
return false;
}
return true;
}
var t=document.getElementById("TextBox1").value;
var t2=document.getElementById("TextBox2").value; if(Date.parse(new Date(t))>Date.parse(new Date(t2)))
{
alert("a");
return false;
}else
{
alert("aa");
}