The totalSeconds() method returns the duration converted to seconds.
DayPilot.Duration.totalSeconds()Returns the duration converted to seconds. If the duration includes milliseconds, the result will be a fractional number.
const seconds = new DayPilot.Duration("2020-01-01T00:00:00", "2020-01-05T12:30:15.100").totalSeconds(); // 390615.1