Bug? What happened on 29 October 1984?

Status
Not open for further replies.

JackKirk

Well-Known Member
Licensed User
Longtime User
Hi,

This has me mystified, if you run this bit of code:
B4X:
Private Sub AppStart(Form1 As Form, Args() As String)

    DateTime.DateFormat="yyyy-MM-dd"

    Private wrk_datelong1, wrk_datelong2 As Long

    wrk_datelong2 = DateTime.DateParse("1984-10-25")

    wrk_datelong1 = DateTime.DateParse("1984-10-26")
    Log("1984-10-26 " & wrk_datelong1 & " " & (wrk_datelong1 - wrk_datelong2))
    wrk_datelong2 = wrk_datelong1

    wrk_datelong1 = DateTime.DateParse("1984-10-27")
    Log("1984-10-27 " & wrk_datelong1 & " " & (wrk_datelong1 - wrk_datelong2))
    wrk_datelong2 = wrk_datelong1

    wrk_datelong1 = DateTime.DateParse("1984-10-28")
    Log("1984-10-28 " & wrk_datelong1 & " " & (wrk_datelong1 - wrk_datelong2))
    wrk_datelong2 = wrk_datelong1

    wrk_datelong1 = DateTime.DateParse("1984-10-29")
    Log("1984-10-29 " & wrk_datelong1 & " " & (wrk_datelong1 - wrk_datelong2) & " <<<<<<<<<")
    wrk_datelong2 = wrk_datelong1

    wrk_datelong1 = DateTime.DateParse("1984-10-30")
    Log("1984-10-30 " & wrk_datelong1 & " " & (wrk_datelong1 - wrk_datelong2))
   
    'StartMessageLoop
   
End Sub
the log will show:
Waiting for debugger to connect...
Program started.
1984-10-26 467560800000 86400000
1984-10-27 467647200000 86400000
1984-10-28 467733600000 86400000
1984-10-29 467816400000 82800000 <<<<<<<<<
1984-10-30 467902800000 86400000
Notice the line in the log for 1984-10-29 - it is saying that there were only 82800000 ticks on this day whereas every other day had 86400000 - a difference of 3,600,000

Was there some time correction or something on this day or is it a bug?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…