Using FormatLocalTime method inside a plugin results in an error

Save the following code snippet as local plugin (step 1):

local now = DateTime.now()
now:FormatLocalTime("LL", "en-150")

Restart studio (step 2), and open any place (step 3). You should get a following error:

Error in loading DateTimeLocaleConfig file of en-150 (Unable to load rbxasset://configs/DateTimeLocaleConfigs/en-150.json)

eRL9FeumIA

If you don’t get the error, try to repeat the last 2 steps (2,3) few more times.

Try “en_150”. With the underscore, you should not see any errors.

2 Likes

Indeed,

print(DateTime.now():FormatLocalTime("LL", "en_150"))

works as expected

1 Like

I see, but I think that’s a bug? The docs show with -, and not _. Additionally, game.LocalizationService.SystemLocaleId returns with - instead of _.

1 Like

Actually, you’re right. My bad. We do not support en-150 locale at the moment. Right now both en_150 and en-150 would default to en-US silently after first use.
Ah… Got it. It is set if you set locale format to English (Europe) on newer Windows. Thanks!

1 Like

Sorry for initial misunderstanding. @Daw588. The en-150 support should be in one of the future releases.

1 Like

If you try it,

print(DateTime.now():FormatLocalTime("LLLL", "en_150"))

Should just work w/o errors in Studio. Giving proper 24h time format.

1 Like

It appears this issue has been fixed. Thank you!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.