harsh
27-01-2017, 20:50
Here's a fun one::D
Watch what happens to the result when the day goes from December 29th to December 30th.
I also tried adding -1 second with a different result.
----8<-------------------------------------------------------
Dim date, time As String
'---Load Console and DT Modules
Uses "Console"
Uses "dt"
'--- These are the strings
date="12-29-2016"
time="15:38:44"
PrintL DT_DateTimeSubSeconds(date,time,1) '--- subtract a second
'--- Advance the date
date="12-30-2016"
PrintL DT_DateTimeSubSeconds(date,time,1) '--- whoopsie!
PrintL DT_DateTimeAddSeconds(date,time,-1) '--- add (-1) second -- oof!
WaitKey
------------------------------------------------------->8----
Watch what happens to the result when the day goes from December 29th to December 30th.
I also tried adding -1 second with a different result.
----8<-------------------------------------------------------
Dim date, time As String
'---Load Console and DT Modules
Uses "Console"
Uses "dt"
'--- These are the strings
date="12-29-2016"
time="15:38:44"
PrintL DT_DateTimeSubSeconds(date,time,1) '--- subtract a second
'--- Advance the date
date="12-30-2016"
PrintL DT_DateTimeSubSeconds(date,time,1) '--- whoopsie!
PrintL DT_DateTimeAddSeconds(date,time,-1) '--- add (-1) second -- oof!
WaitKey
------------------------------------------------------->8----