inTimeZone <- function(tz, code) {
previous_tz <- currentTimeZone()
tryCatch({
Sys.setenv(TZ=tz)
eval(code)
}, finally={
Sys.setenv(TZ=previous_tz)
})
}
currentTimeZone <- function() {
Sys.getenv("TZ", Sys.timezone())
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.