C clooney48 Active Member Licensed User Longtime User Dec 9, 2013 #1 Why do I get "Mittwoch" as result instead of "Dienstag" with this code? B4X: DefaultValue = "10/12/2013 22:12" Dim d1() d1 = Regex.Split(" ", DefaultValue) DateTicks = DateTime.DateParse(d1(0)) Dim df As String = DateTime.DateFormat DateTime.DateFormat = "EEEE" Dim res As String = DateTime.Date(DateTicks) Log("Heute ist: " & res)
Why do I get "Mittwoch" as result instead of "Dienstag" with this code? B4X: DefaultValue = "10/12/2013 22:12" Dim d1() d1 = Regex.Split(" ", DefaultValue) DateTicks = DateTime.DateParse(d1(0)) Dim df As String = DateTime.DateFormat DateTime.DateFormat = "EEEE" Dim res As String = DateTime.Date(DateTicks) Log("Heute ist: " & res)
Erel B4X founder Staff member Licensed User Longtime User Dec 10, 2013 #2 You should declare DateTicks as Long: B4X: Dim DateTicks As Long = DateTime.DateParse(d1(0)) I think that you are confusing the month with the days. You probably expect this format: B4X: DateTime.DateFormat = "dd/MM/yyyy" Upvote 0
You should declare DateTicks as Long: B4X: Dim DateTicks As Long = DateTime.DateParse(d1(0)) I think that you are confusing the month with the days. You probably expect this format: B4X: DateTime.DateFormat = "dd/MM/yyyy"
C clooney48 Active Member Licensed User Longtime User Dec 10, 2013 #3 Yes, the wrong type of DateTicks was the problem. Thanks! Upvote 0