יום ראשון, 23 בדצמבר 2012

How to get the Date difference in Days, Hours, Minutes, Seconds




A one liner solution for requirement to find out the date difference between two different dates in eScript:



function
Service_PreInvokeMethod (MethodName, Inputs, Outputs)

{

var Date1 = new
Date("12/22/2012");

var Date2 = new
Date("12/23/2012");



TheApplication().RaiseErrorText(

"Date1 =" +
Date1 +

"\n Date2 =
" + Date2 +

"\n Date
Difference in Days = " + (Date2.getTime() -
Date1

אין תגובות:

הוסף רשומת תגובה