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

תגובות

פוסטים פופולריים מהבלוג הזה

Profile Attributes and Open UI

SBL-BPR-00191: The rowId of the active row of the primary buscomp '%1', '%2', does not match the Primary Id

SBL-SVC-00150