I see that the screenshot I posted was showing the Date.parse() not the DateTime.parse(), however I assure you that is where that error came from.
![]()
And here are the values for the fields used:
![]()
Please feel free to try using DateTime.parse().getTime() and see if it works but it does not for me.
Also a note to all doing time comparisons, you have to be weary of only having a timestamps but the dates may cross days. This works using the ‘hard-coded’ date string and Date.parse() but still seems a bit hacky for me:
(Date.parse('01/02/2019 ' + $end_time).getTime() >= Date.parse('01/02/2019 ' + $start_time).getTime()) ? ((Date.parse('01/02/2019 ' + $end_time).getTime() - Date.parse('01/02/2019 ' + $start_time).getTime()) / 1000) : ((Date.parse('01/02/2019 ' + $end_time).getTime() - Date.parse('01/01/2019 ' + $start_time).getTime()) / 1000)