Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i have one date1 =12/08/1991
one more date2 = 17/06/1995
how to give condition if (date2
Posted
Comments
Sergey Alexandrovich Kryukov 10-Dec-15 0:28am    
If date2 — what?
—SA
Member 11970398 10-Dec-15 1:47am    
can u help me with this
Member 11970398 10-Dec-15 0:38am    
how to compare 2 dates if date 2 is less than date1 give error

1 solution

Please see my comment to the question. You need to ask questions in more accurate way.

Anyway, as JavaScript Date (constructor function) produces objects based on number of milliseconds, that is, on some integer object with arithmetic order, quite naturally, you can use the operators '==', '===', '!=', '!==', '>', '<', '>=' or '<='.

Please see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date[^].

—SA
 
Share this answer
 
Comments
Member 11970398 10-Dec-15 1:47am    
i have one date1 =12/08/1991
another date2 = 17/06/1995
how to compare 2 dates if date2 is less than date1 give error
Sergey Alexandrovich Kryukov 10-Dec-15 2:19am    
Which part of my answer was unclear?
—SA
Sergey Alexandrovich Kryukov 10-Dec-15 2:19am    
"Less" means <
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900