Android Question Bug in DatePicker in B4J

SeaBee

Member
Licensed User
Summary: If the default DataPicker is passed date ticks for 31st December of some years earlier, then the display shows 31/12/year + 1
Reproduction Steps:
B4X:
Sub dpTestDate_ValueChanged (Value As Long) 
   
    jTicks = Value
   
    Dim OK As Boolean = Control.SomeSub(jTicks)
   
 End Sub

Sub Button1_Click
   
    DPTestDate.DateTicks =  946591200000 'Date ticks for 31/12/1999
   
End Sub

Actual Behavior: Displays 31/12/2000, actual date from ticks is 31/12/1999
Expected Behavior: Should display 31/12/1999.
Note: If the DatePicker is opened, the correct date is displayed on the selection grid, but the display does not change.

Bug discovered because, believe it or not, in astronomy there is such a date as the zeroeth of January.
 

DonManfred

Expert
Licensed User
Longtime User
B4X:
    Dim date As Long = DateTime.DateParse("12/31/1999")
    Log(date)

prints 946594800000 to the log. Not 946591200000
 
Upvote 0

SeaBee

Member
Licensed User
Weird!

B4X:
Dim thisdate As String = DateUtils.TicksToString(946591200000)
  
Log(thisdate) 'Date/time default format

...gives 12/31/1999 00:00:00

EDIT: Your 946591200000 gives 12/31/1999 01:00:00. DST?
 
Upvote 0
Top