Title: | Time Zone Database Updater |
---|---|
Description: | Download and compile any version of the IANA Time Zone Database (also known as Olson database) and make it current in your R session. Beware: on Windows 'Cygwin' is required! |
Authors: | Sebastien Thonnard |
Maintainer: | Sebastien Thonnard <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.5 |
Built: | 2025-03-01 04:20:24 UTC |
Source: | https://github.com/sthonnard/tzupdater |
Get the active tz database version
get_active_tz_db()
get_active_tz_db()
Active tz database for the current session.
# Get the active tz database in your session: get_active_tz_db()
# Get the active tz database in your session: get_active_tz_db()
Get the name of the latest version available at IANA website.
get_last_published_tz()
get_last_published_tz()
Latest IANA tz db version name or Unknown if not found.
# Will return for instance "2019c" get_last_published_tz()
# Will return for instance "2019c" get_last_published_tz()
Install latest tz database if required, and make it active.
Will stop in case it is not possible to know what the last version is.
If it happens browse IANA website at https://www.iana.org/time-zones and install last version with install_tz(version).
?install_tz for details.
install_last_tz( zic_path = NA, target_folder = paste0(tempdir(), "/tzupdater/data/IANA_release"), verbose = TRUE )
install_last_tz( zic_path = NA, target_folder = paste0(tempdir(), "/tzupdater/data/IANA_release"), verbose = TRUE )
zic_path |
Optional for Windows: path to the zic compiler (if not in C:\Cygwin\usr\sbin). |
target_folder |
Optional target folder. Default will be tzupdater/data/IANA_release as subdirectory of your temp dir. |
verbose |
Print information to the console TRUE/FALSE. Default TRUE. |
None.
# Get the latest version available and compile. # If your tz database is already the latest, do nothing. install_last_tz() # Same, but more verbose. install_last_tz(verbose = TRUE) # On Windows: install latest tz database, with Cygwin installed in c:\Cygwin. install_last_tz(zic_path="C:\\Cygwin\\usr\\sbin")
# Get the latest version available and compile. # If your tz database is already the latest, do nothing. install_last_tz() # Same, but more verbose. install_last_tz(verbose = TRUE) # On Windows: install latest tz database, with Cygwin installed in c:\Cygwin. install_last_tz(zic_path="C:\\Cygwin\\usr\\sbin")
Download and compile a tz database from the IANA website and make it active as an option. In case the tz db exists already, do not download again.
install_tz( tgt_version = "2019c", zic_path = NA, target_folder = paste0(tempdir(), "/tzupdater/data/IANA_release"), show_zic_log = FALSE, err_stop = TRUE, activate_tz = TRUE, verbose = TRUE, fail_if_zic_missing = FALSE )
install_tz( tgt_version = "2019c", zic_path = NA, target_folder = paste0(tempdir(), "/tzupdater/data/IANA_release"), show_zic_log = FALSE, err_stop = TRUE, activate_tz = TRUE, verbose = TRUE, fail_if_zic_missing = FALSE )
tgt_version |
Version to download and compile (eg 2019c, 2019a). |
zic_path |
Optional for Windows: path to the zic compiler (if not in C:\Cygwin\usr\sbin) |
target_folder |
Optional target folder. Default will be tzupdater/data/IANA_release as in tempdir() |
show_zic_log |
Optional: show logs from the zic compiler (TRUE/FALSE). Default FALSE. |
err_stop |
Stop on error (TRUE/FALSE). Default TRUE. Recommanded to TRUE. |
activate_tz |
Activate the tz database once installed. Default TRUE. |
verbose |
Print additional information to the console TRUE/FALSE. Default TRUE. |
fail_if_zic_missing |
Stop execution if zic is missing (default FALSE, will only display a message) |
# Install tz database 2019c install_tz("2019c")
# Install tz database 2019c install_tz("2019c")