iOS Question DateTimeParse problem

Tomas Petrus

Active Member
Licensed User
Longtime User
Hi guys what am I missing

working in B4A

B4X:
DateTime.DateFormat = "dd.MM.yyyy" //format in which user enter the date
Dim t As Long = DateTime.DateTimeParse(Datum, Cas) //line 902
DateTime.DateFormat = "yyyy-MM-dd" //output format

error in B4i
B4X:
Error occurred on line: 902 (Main)
Error parsing date string.
Stack Trace: (
  CoreFoundation       <redacted> + 252
  libobjc.A.dylib      objc_exception_throw + 56
  CoreFoundation       <redacted> + 0
  result               -[B4IDateTime NSDateToTicks:] + 100
  result               -[B4IDateTime DateTimeParse::] + 344
  CoreFoundation       <redacted> + 144
  CoreFoundation       <redacted> + 284
  result               +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
  result               -[B4IShell runMethod:] + 448
  result               -[B4IShell raiseEventImpl:method:args::] + 1648
 result               -[B4IShellBI raiseEvent:event:params:] + 1580
 result               +[B4IDebug delegate:::] + 80
 result               -[b4i_main _stringtodate::] + 468
 result               -[b4i_main _rozdeldatumcas:] + 1068
 CoreFoundation       <redacted> + 144
 CoreFoundation       <redacted> + 284
 result               +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
 result               -[B4IShell runMethod:] + 448
 result               -[B4IShell raiseEventImpl:method:args::] + 2172
 result               -[B4IShellBI raiseEvent:event:params:] + 1580
 result               -[B4IDebugResumableSub resume::] + 356
 result               -[B4I checkAndRunWaitForEvent:event:params:] + 552
 result               -[B4IShellBI raiseEvent:event:params:] + 1436
 result               -[B4ICommon CallSub4::::] + 344
 result               -[B4ICommon CallSub2::::] + 360
 result               -[b4i_httpjob _complete::] + 888
 result               -[b4i_httputils2service _completejob::::] + 1288
 result               -[b4i_httputils2service _hc_responsesuccess::] + 636
 CoreFoundation       <redacted> + 144
 CoreFoundation       <redacted> + 284
 result               +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
 result               -[B4IShell runMethod:] + 448
 
Top