| use_client_tz | R Documentation |
Uses some Javascript to pass the client's timezone to the Shiny session.
use_client_tz(inputId = "_client_tz")
get_client_tz(
inputId = "_client_tz",
session = shiny::getDefaultReactiveDomain()
)
inputId |
character string, name of shiny input. Defaults to "_client_tz".
When used in |
session |
a |
use_client_tz(): HTML tags to be included in Shiny UI
timezone
if(interactive()){
shiny::shinyApp(
ui = shiny::fluidPage(use_client_tz(), shiny::textOutput("time")),
server = function(input, output, session) {
# can be used outside of reactive context, if desired
tz <- get_client_tz()
time <- format(Sys.time(), format = "%x %X", tz = tz)
output$time <- renderText(paste0(tz,": ", time))
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.