Hello
I'm trying to parse this datetime: 18-mrt-2021 10:43:18
mrt is short for Maart, which is March in Dutch.
I tried this:
But the datetime was unparsable. I thought it might have somehting to do with localization settings. I found this website: https://www.localeplanet.com/java/nl-NL/index.html
Great, the short months on that page show: jan., feb., mrt., apr., mei, jun., jul., aug., sep., okt., nov., dec.
So that could (should) work? I tried setting the locale with this code:
However, an error is thrown stating
What is wrong here? To be fair: I'm only guessing that localization has something to do with my problem. If you spot another problem, great!
I'm trying to parse this datetime: 18-mrt-2021 10:43:18
mrt is short for Maart, which is March in Dutch.
I tried this:
B4X:
DateTime.TimeFormat = "dd-MMM-YYYY HH:mm:ss"
But the datetime was unparsable. I thought it might have somehting to do with localization settings. I found this website: https://www.localeplanet.com/java/nl-NL/index.html
Great, the short months on that page show: jan., feb., mrt., apr., mei, jun., jul., aug., sep., okt., nov., dec.
So that could (should) work? I tried setting the locale with this code:
B4X:
Dim jo As JavaObject
jo.InitializeStatic("java.util.Locale").RunMethod("setDefault", Array(jo.GetField("nl_NL")))
However, an error is thrown stating
java.lang.RuntimeException: Field: nl_NL not found in: java.util.Locale
What is wrong here? To be fair: I'm only guessing that localization has something to do with my problem. If you spot another problem, great!