Home > Web Front-end > JS Tutorial > javascript time comparison implementation code_time and date

javascript time comparison implementation code_time and date

WBOY
Release: 2016-05-16 18:43:13
Original
1105 people have browsed it

In web development, it is sometimes necessary to compare the time in the input box (mainly the start time and end time). After searching online, I found that many of them are invalid. The following method has been tested by my brother and is indeed effective, so I would like to share it. (Please pay attention to the red part)

function ValidtorTime(){                                                                                                                                                         
var d2 = new Date(document.getElementById('txbToDate')

.value.replace(/-/g, "/")); var d2 if(d1>d2)                                                                                                                                                                                                          ;
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template