How can a Saved Search return difference in Time between Now and Last Modified Date

I am attempting to get the difference in Time (Hours) between two dates.
I am running a Transaction Search with a Formula(Numeric) result as defined by

({now}-{lastmodifieddate})/1000/60/60

With a Now of 3/2/2022 3:28pm and a Last Modified Date of 3/2/2022 3:12pm I am getting a value of
0.00000000309606481481481481481481481481

Meanwhile if I were to run the equivalent code in the console I get.

var then = new Date('2022/03/03 12:00');
console.log(then);
var now = new Date('2022/03/03 12:15');
console.log(now);

console.log(now-then);
console.log((now-then)/1000/60/60);

result:

Wed Mar 02 2022 12:00:00 GMT-0700 (Mountain Standard Time)
Wed Mar 02 2022 12:15:00 GMT-0700 (Mountain Standard Time)
900000
0.25

I do not understand the difference or what I am doing wrong in order to get such a strange result from NetSuite.

Beginner Asked on March 2, 2022 in Saved Searches.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor   Become a Sponsor