List of locales? (Using wday with Sys.getlocale() for GMT)

For wday() from lubridate library, the documentation shows locale = Sys.getlocale("LC_TIME") argument. As I look further into it, it seems that 1) it is distro/OS dependent and 2) no 'GMT' locale.

  1. I looked further into it, but it seems that it is distro/OS dependent. Can I just spam the same command in multiple lines with whatever timezone needs to be referenced? For example, in the documentation, it is written as the following:
Sys.setlocale("LC_TIME", "de")     # Solaris: details are OS-dependent
Sys.setlocale("LC_TIME", "de_DE")  # Many Unix-alikes
Sys.setlocale("LC_TIME", "de_DE.UTF-8")  # Linux, macOS, other Unix-alikes
Sys.setlocale("LC_TIME", "de_DE.utf8")   # some Linux versions
Sys.setlocale("LC_TIME", "German") # Windows

So does this mean that I would have to use all five options if the code switches machines?

  1. My intention is something along the lines of Sys.setlocale("LC_TIME", "GMT") but I was unable to find a list of timezones for GMT/UTC (also tried lowercase). Is there one? What is GMT's equivalent?

Hi @pathos,
Get a list of all time zone names that R knows about with the function OlsonNames() (almost 600 of them).
No sure this helps with your locale problem though!

1 Like

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.