Error occurred on line: 185 (MailParser)
java.text.ParseException: Unparseable date: "Wed, 28 Mar 2018 13:11:26 +0200"
at java.text.DateFormat.parse(DateFormat.java:362)
at anywheresoftware.b4a.keywords.DateTime.DateParse(DateTime.java:148)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at com.Misiolvas.mailparser._dateparse2(mailparser.java:221)
at com.Misiolvas.mailparser._parseheaders(mailparser.java:759)
at com.Misiolvas.mailparser._parsemail(mailparser.java:87)
at com.Misiolvas.email._pop_downloadcompleted(email.java:689)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Sub dateparse2( sd As String) As String
Dim jo As JavaObject
jo.InitializeStatic("java.util.Locale")
jo.RunMethod("setDefault", Array As Object(jo.GetField("ENGLISH")))
Dim df As String = DateTime.DateFormat
Dim res As Long
Try
DateTime.DateFormat = "EEE, dd MMM yyyy HH:mm:ss ZZZ"
res = DateTime.DateParse(sd.trim) '<---- line 185
DateTime.DateFormat = df
Return DateTime.Date(res)
Catch
res = 0
Log("Error parsing Date 2: " & sd)
Return sd
End Try
End Sub