Hello,
i have a Problem to add one day to the 30.10.2011?!
if i use the same code and add one day to the 31.11.2011 then it works
i think this is a problem from b4a or?
here is my testcode:
if i run this code then is the first calculation wrong! and the second is right.
i have a Screenshoot attached with the result of this program.
andy
i have a Problem to add one day to the 30.10.2011?!
if i use the same code and add one day to the 31.11.2011 then it works
i think this is a problem from b4a or?
here is my testcode:
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Startdatum,Datum_count As Long
Dim label1, label2 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
label1.Initialize("")
label2.Initialize("")
activity.AddView(label1,0dip,0dip,300dip,120dip)
activity.AddView(label2,0dip,100dip,300dip,220dip)
DateTime.DateFormat = "dd.MM.yyyy"
startdatum = DateTime.DateParse("30.10.2011")
Datum_count = Startdatum
datum_count = datum_count + DateTime.TicksPerDay
label1.Text = "Startdatum:" & DateTime.Date(startdatum) & CRLF &"Startdatum + 1 Tag: " & DateTime.Date(datum_count)
startdatum = DateTime.DateParse("31.10.2011")
Datum_count = Startdatum
datum_count = datum_count + DateTime.TicksPerDay
label2.Text = "Startdatum:" & DateTime.Date(startdatum) & CRLF &"Startdatum + 1 Tag: " & DateTime.Date(datum_count)
End Sub
if i run this code then is the first calculation wrong! and the second is right.
i have a Screenshoot attached with the result of this program.
andy