English 中文(简体)
日期与javascript相比
原标题:Multiple date compare in javascript

我试图验证、获取和比较2个日期。

这些日期来自2个文本投入,现作为以下实例编排:17/01/2011 00:00<>/code>。

我如何用日期标语将这种描述改为日期?

我试图根据这些条件证明:

  1. Date must be in the correct format (17/01/2011 00:00)
  2. Date must be in the future (How do I do that considering JS runs on Local and date can be set incorrectly on the user s machine?
  3. First date must be before second date. (it s a from_date -> to_date input).

请你协助?

感谢

最佳回答
问题回答

至于认证的格式,你可以使用一个管理机构来这样做。

现在需要一个服务器要求数据。 一种选择是,用户使用背书的语言(php,java, ......)上网。 另一种选择是要求一个有网站要求的时间服务器提供时间。 答案可以是模拟案文或XML,或者你可能需要与另一个议定书,如SOAP联系。

比较这2个日期,你可以将其转换为零,然后简单地比较这些数值。 Java原标日期也有助于转换和比较。

如果不知道时间区,你就无法操纵时间和日期。

如果某一日期的说明不包括格林尼治平时抵消,那么,除非你增加一条规则来说明时间区,否则你就不得不对时间区进行猜测,或者只想在一天之内或如此准确。





相关问题
Mysql compaire two dates from datetime?

I was try to measure what is faster and what should be the best way to compare two dates, from datetime record in MySql db. There are several approaches how to grab a date from date time, but I was ...

iPhone Date Picker rolls over to 2010 on December 27th?

So I implemented a UIDatepicker in one of my applications for scheduling and autodialing teleconferences... everything is pretty much ready to go except, while testing I noticed that when the date ...

Convert date Python

I have MMDDYY dates, i.e. today is 111609 How do I convert this to 11/16/2009, in Python?

specifying date format when using $form->inputs() in CakePHP

I am wondering if there is a way to specify the date format in the forms created using CakePHP s $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() ...

NSDateFormat, super simple! Where am I screwing up?

Ok, this is really simple, maybe I m a getting a bit burnt out, but seems like it should work, Query XML feed, put out date string, format, display in a cell. The issue is I m a getting a NULL ...

sqlite writing a date into an email

I am exporting a date value from sqlite and placing it into an email. The date appears like this 279498721.322872 I am using Objective C in an Iphone App. Does anyone know how to make this export ...