Calculate time difference in scripted field

The question is how to get the difference from following date format in a second?
For example, if date1 = 4/21/2021 7:53:50 and date2 = 6/21/2021 7:54:10, the answer should 20 .

I am trying below code but it is providing wrong result that is: -40

if (!doc['QuoteRequestTime'].empty && !doc['QuoteResponseTime'].empty) { return (doc['QuoteRequestTime'].value.second - doc['QuoteResponseTime'].value.second) } else { return null; }