H hzq200409 Member Licensed User Sep 30, 2020 #1 The following problems occurred when I formatted the date: B4X: Dim currentTime As String DateTime.DateFormat = "EEE, dd MMM yyyy HH:mm:ss z" 'The expected : Tue, 30 Jul 2019 08:39:29 GMT currentTime = DateTime.Date(DateTime.Now) Log(currentTime) 'My system language is Chinese. Results: 周三, 30 9月 2020 15:24:26 CST Do I have to change the system language? Because I use the jOkHttpUtils2. Statement :SetHeader("Date",currentTime).Encountered an error: B4X: Error occurred on line: 244 (HttpJob) java.lang.IllegalArgumentException: Unexpected char 0x5468 at 0 in Date value: 鍛ㄤ笁, 30 9鏈?2020 15:24:36 CST
The following problems occurred when I formatted the date: B4X: Dim currentTime As String DateTime.DateFormat = "EEE, dd MMM yyyy HH:mm:ss z" 'The expected : Tue, 30 Jul 2019 08:39:29 GMT currentTime = DateTime.Date(DateTime.Now) Log(currentTime) 'My system language is Chinese. Results: 周三, 30 9月 2020 15:24:26 CST Do I have to change the system language? Because I use the jOkHttpUtils2. Statement :SetHeader("Date",currentTime).Encountered an error: B4X: Error occurred on line: 244 (HttpJob) java.lang.IllegalArgumentException: Unexpected char 0x5468 at 0 in Date value: 鍛ㄤ笁, 30 9鏈?2020 15:24:36 CST
Erel B4X founder Staff member Licensed User Longtime User Sep 30, 2020 #2 Try this: https://www.b4x.com/android/forum/threads/unparseable-date.75927/post-481825