Hello everyone!
Recently I met a demand of the time required to verify input
I will write this
Like this should be pretty easy to understand
If you do not understand can ask me
Cheers!
Recently I met a demand of the time required to verify input
I will write this
//Here is the time to check var goTime = '2016-01-20 12:00'; //Verify time format, here I would like to use 2016-01-21 14:04 if (goTime.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$/) == null )//Time format { alert("Time format Error"); } //Check in time is greater than the time now var now = new Date();//new a Date Object //now.getTime() return UNIX time //Date.parse will return date object if (Date.parse(goTime) <= Date.parse(now.getTime())) { alert("goTime is before now time"); } else { alert("goTime is After now time"); }
Like this should be pretty easy to understand
If you do not understand can ask me
Cheers!

Message Board
Feel free to leave suggestions and share! Thanksgiving!