The one case that I can see where your (Abishek Saxena) answer won't work is if you experience this 1 second difference between LastModifiedDate
and ClosedDate
on a minute boundary.
A difference between those two fields should be rare enough as is, and a difference across a minute boundary should be rarer still. So with that in mind, it may not make sense to put more effort into this.
However, I think there's a simpler approach that will end up being more accurate.
Formulas allow us to add/subtract with datetimes, so if you simply subtract your two datetime fields and check to see if the difference is greater than some threshold you should end up with what you want.
(LastModifiedDate - ClosedDate) > 0.0000116
Subtracting datetimes gives you a decimal result, and is based on the number of seconds between the two datetimes.
Whole number part = number of complete days in the difference
Decimal part = remaining number of seconds / 86400 (the number of seconds in a day)
So if you want to find if your two datetimes are within X seconds of eachother, the number you want to compare against is X / 86400
, for 1 second that's roughly 0.00001157407.