Formatting problems for DateTime

hzq200409

Member
Licensed User
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
 
Top