Use inWholeSeconds property instead or convert toDouble(SECONDS) if a double value is required.
toDouble(DurationUnit.SECONDS)
The value of this duration expressed as a Double number of seconds.