Descartex Well-Known Member Licensed User Longtime User Sep 24, 2019 #1 Hi!! I've almost finished an app and, suddenly, it raised some weird errors on my app, such as: 1.- App closes when reaches this line: Code: DateTime.DateFormat="dd/MM/YYYY" 2.- App closes also when reaches this lines: Code: Variables.DataCheck.Put("Data",DateTime.Now) Variables.DataCheck.Put("Sync",DateTime.Now) 'Being Variables.DataCheck a Map rightly initialized In both cases it doesn't like the format: First case, it raises "Unknown character pattern Y" On second, it doesn't like the Caps of the map key... I was using this for long time (from the beginning of the project), without problem. I didn't made any change on my version before it started to fail... Anyone has experimented any similar??? Best Regards.
Hi!! I've almost finished an app and, suddenly, it raised some weird errors on my app, such as: 1.- App closes when reaches this line: Code: DateTime.DateFormat="dd/MM/YYYY" 2.- App closes also when reaches this lines: Code: Variables.DataCheck.Put("Data",DateTime.Now) Variables.DataCheck.Put("Sync",DateTime.Now) 'Being Variables.DataCheck a Map rightly initialized In both cases it doesn't like the format: First case, it raises "Unknown character pattern Y" On second, it doesn't like the Caps of the map key... I was using this for long time (from the beginning of the project), without problem. I didn't made any change on my version before it started to fail... Anyone has experimented any similar??? Best Regards.
DonManfred Expert Licensed User Longtime User Sep 24, 2019 #2 Descartex said: First case, it raises "Unknown character pattern Y" Click to expand... Y is WeekYear, y is Year https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html Upvote 0
Descartex said: First case, it raises "Unknown character pattern Y" Click to expand... Y is WeekYear, y is Year https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
LucaMs Expert Licensed User Longtime User Sep 24, 2019 #3 Descartex said: DateTime.DateFormat="dd/MM/YYYY" Click to expand... Y must be lowercase: https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html Descartex said: On second, it doesn't like the Caps of the map key... Click to expand... Keys are case sensitive and you can use any combination of uppercase and lowercase letters (and not just alphabetic characters, of course) Upvote 0
Descartex said: DateTime.DateFormat="dd/MM/YYYY" Click to expand... Y must be lowercase: https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html Descartex said: On second, it doesn't like the Caps of the map key... Click to expand... Keys are case sensitive and you can use any combination of uppercase and lowercase letters (and not just alphabetic characters, of course)
Descartex Well-Known Member Licensed User Longtime User Sep 24, 2019 #4 But why it worked without any change??? I can't explain it... Upvote 0
LucaMs Expert Licensed User Longtime User Sep 24, 2019 #5 Descartex said: But why it worked without any change??? I can't explain it... Click to expand... Perhaps because it is not so (?) Upvote 0
Descartex said: But why it worked without any change??? I can't explain it... Click to expand... Perhaps because it is not so (?)
Descartex Well-Known Member Licensed User Longtime User Sep 24, 2019 #6 And how to explain it works on 4 devices and fails on 3 others? Same code, same Java version, same IDE version... Compiled versions works on my devices and not on others... Upvote 0
And how to explain it works on 4 devices and fails on 3 others? Same code, same Java version, same IDE version... Compiled versions works on my devices and not on others...
rraswisak Active Member Licensed User Longtime User Sep 25, 2019 #7 Did you check android language setting for each device ? are they use same choice Upvote 0
Descartex Well-Known Member Licensed User Longtime User Sep 25, 2019 #8 rraswisak said: Did you check android language setting for each device ? are they use same choice Click to expand... That can be the problem... on those it fails, are configured on Portuguese, mine are Spanish... Upvote 0
rraswisak said: Did you check android language setting for each device ? are they use same choice Click to expand... That can be the problem... on those it fails, are configured on Portuguese, mine are Spanish...
rraswisak Active Member Licensed User Longtime User Sep 25, 2019 #9 Maybe, previously i'm facing same problem while date compare between server and device date, i thought it was Date & Time setting matter but it doesn't affect, until i know that using different Language setting is the cause (i don't know why), the working one using English (US) while the other English (Canada). So i set all device to English (US) and the issue has gone. Upvote 0
Maybe, previously i'm facing same problem while date compare between server and device date, i thought it was Date & Time setting matter but it doesn't affect, until i know that using different Language setting is the cause (i don't know why), the working one using English (US) while the other English (Canada). So i set all device to English (US) and the issue has gone.
Erel B4X founder Staff member Licensed User Longtime User Sep 25, 2019 #10 https://www.b4x.com/android/forum/threads/unparseable-date.75927/#post-481825 Upvote 0
LucaMs Expert Licensed User Longtime User Sep 25, 2019 #11 Erel said: https://www.b4x.com/android/forum/threads/unparseable-date.75927/#post-481825 Click to expand... I suppose it should only be used temporarily, only to work on dates, otherwise, if I'm not mistaken, the language and currency would also change. So we would also need the "reverse" code, like resetting the default Local, the device setting. Upvote 0
Erel said: https://www.b4x.com/android/forum/threads/unparseable-date.75927/#post-481825 Click to expand... I suppose it should only be used temporarily, only to work on dates, otherwise, if I'm not mistaken, the language and currency would also change. So we would also need the "reverse" code, like resetting the default Local, the device setting.