S SeaBee Member Licensed User Sep 9, 2019 #1 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: Code: 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.
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: Code: 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 Sep 9, 2019 #2 Code: Dim date As Long = DateTime.DateParse("12/31/1999") Log(date) prints 946594800000 to the log. Not 946591200000 Upvote 0
Code: Dim date As Long = DateTime.DateParse("12/31/1999") Log(date) prints 946594800000 to the log. Not 946591200000
S SeaBee Member Licensed User Sep 9, 2019 #3 Weird! Code: 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
Weird! Code: 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?
DonManfred Expert Licensed User Longtime User Sep 9, 2019 #4 SeaBee said: ...gives 12/31/1999 00:00:00 Click to expand... you are still using the wrong value. Try it with 946594800000 Upvote 0
SeaBee said: ...gives 12/31/1999 00:00:00 Click to expand... you are still using the wrong value. Try it with 946594800000
Erel B4X founder Staff member Licensed User Longtime User Sep 9, 2019 #5 Moved to the questions forum. Not sure which date picker you are using but you should never use ticks values like this. The represented date will be different based on the device time zone. Upvote 0
Moved to the questions forum. Not sure which date picker you are using but you should never use ticks values like this. The represented date will be different based on the device time zone.