Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialLisa Steendam
6,825 PointsMy Locale isn't recognized
I would like to use the Belgian Locale but I get an error on both Locale.BE and Locale.nl_BE The error is "cannot resolve symbol 'BE'" or "cannot resolve symbol 'nl_BE'" I will use the UK Locale now, but does anyone know what I should use for Belgium?
Lisa Steendam
6,825 PointsThank you, that solved it .
Raghda Talaa't
2,944 PointsYou're welcome, but please make it best answer so that others know that this question has been solved.
Lisa Steendam
6,825 PointsYou need to put your answer in an answer ("Add answer") not a comment for me to be able to select it as best answer.
Raghda Talaa't
2,944 PointsThank you ;)
1 Answer
Raghda Talaa't
2,944 PointsYou can use it like this:
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", new Locale("be")).format(now);
Doing so will format the dates according to that Locale whenever relevant.
You can also use getDefault() to get an appropriate locale for the user of the device you're running on, or getAvailableLocales() to get a list of all the locales available on the device you're running on.
Raghda Talaa't
2,944 PointsRaghda Talaa't
2,944 PointsYou can use it like this:
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", new Locale("be")).format(now);
Doing so will format the dates according to that Locale whenever relevant.
You can also use getDefault() to get an appropriate locale for the user of the device you're running on, or getAvailableLocales() to get a list of all the locales available on the device you're running on.