Hi,
When I add 28 or 29 days to the 1st October, I get the same result of 29th October! Works fine adding to the 1st September.
Example code below. Any ideas what's going on?
When I add 28 or 29 days to the 1st October, I get the same result of 29th October! Works fine adding to the 1st September.
Example code below. Any ideas what's going on?
B4X:
Dim StartOfMonth As Long
Dim Date1 As Long
Dim Date2 As Long
DateTime.DateFormat = "dd-MM-yyyy"
StartOfMonth = DateTime.DateParse("01-10-2017")
Date1 = StartOfMonth + (DateTime.TicksPerDay * 28)
Date2 = StartOfMonth + (DateTime.TicksPerDay * 29)
Log(DateTime.Date(Date1)) 'Result 29-10-2017
Log(DateTime.Date(Date2)) 'Result 29-10-2017