Friday 15 February 2013

javascript - Subtract two date fields in Days and return value to another fields -


I am trying to create a javascript that would reduce the two date fields (sysdate and targstartdate) Assuming and update another field in the same table.

Try it ...

  & lt; Input type = "text" name = "text1" id = "text1" & gt;   

script

  var date1 = new date ("7/11/2010"); Var date2 = new date ("12/12/2010"); Var TimeDiff = Math.Box (date2.getTime () - date1.getTime ()); Var diffDays = Math.ceil (Timediff / (1000 * 3600 * 24)); Warning (diffDays); . Document.getElementById ("text1") value = diffDays;    

No comments:

Post a Comment