OlsonNames Function in R (Example) | Get List of Known Time Zones
This tutorial demonstrates how to get known time zone locations using the OlsonNames function in the R programming language.
The content of the page is structured like this:
Let’s dive right in…
Example: Get List of Known Time Zone Locations Using OlsonNames() Function
This example illustrates how to create a list of known time zones in R.
For this, we can apply the OlsonNames function as shown below:
OlsonNames() # Apply OlsonNames function # [1] "Africa/Abidjan" "Africa/Accra" # [3] "Africa/Addis_Ababa" "Africa/Algiers" # [5] "Africa/Asmara" "Africa/Asmera" # [7] "Africa/Bamako" "Africa/Bangui" # [9] "Africa/Banjul" "Africa/Bissau" # [11] "Africa/Blantyre" "Africa/Brazzaville" # ...
The previous list contains known time zones that can be used for date and time objects in R:
Video & Further Resources
Have a look at the following video on my YouTube channel. In the video, I’m explaining the R code of this page.
The YouTube video will be added soon.
Besides the video, you may want to have a look at the other articles on this website. You can find a selection of other tutorials below.
- Sys.timezone Function in R
- Change Default Time Zone in R
- Useful Functions in R (Example Codes)
- Introduction to System Calls & Commands
- The R Programming Language
Summary: In this R programming tutorial you have learned how to apply the OlsonNames function. Let me know in the comments section, if you have further questions.
Statistics Globe Newsletter