How to use DateTime:FormatLocalTime() without specifying region

I am working on a puzzle for my game that involves inputting a string with the current date, and I wanted to match the inputted string to the current date with DateTime:FormatLocalTime(), but the problem is that in some regions, dates are ordered differently.

The function seems to require inputting a second string parameter that corresponds to a region, but I want that to be the player’s current region, how do I do this?

1 Like

You can use LocalizationService.SystemLocaleId to find the LocaleId of a user’s LocaleId.

Example:

print("The date is " .. DateTime.now():FormatLocalTime("LL", game:GetService("LocalizationService").SystemLocaleId))
1 Like

Ok, gonna try it later, will mark as solution if it works, which it probably should.

1 Like