It's all about the answers!

Ask a question

how to compare two date of type timestamp?


shweta ranaware (3711053) | asked Aug 14 '15, 5:07 a.m.
Hi..
     I want to write the script that can compare dates .
 for example Planned start  date and Planned end date if Planned End date is entered as greater than planned start date then error message must be displayed in workItem.
How i compare the two dates ?

Please Help.. 

Accepted answer


permanent link
Donald Nong (14.5k614) | answered Aug 17 '15, 1:17 a.m.
I assume that you are talking about JavaScript. In this case, you need to parse the value (most likely a string) into a date value, then compare.
http://www.w3schools.com/js/js_date_methods.asp

If for some reason you are referring to Java, see samples below.
http://javarevisited.blogspot.com.au/2012/02/3-example-to-compare-two-dates-in-java.html
shweta ranaware selected this answer as the correct answer

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.