Search code examples
rshinyproxy

internal time shinyproxy UTC


I successfully deployed an application with shiny and shinyproxy. The purpose of the app is to manually review an algorithm decision

We want to store not only the decision but also the timestamp in which the decision is made, so inside the code we are making use of Sys.time(). Our current time zone is UTC+2 while inside the app when deployed with shinyproxy it seems that Sys.time will give us UTC time ( so 2 hours behind what we'd like to see). I checked the server date and it's ok.

Is there some configuration we can modify on shinyproxy to deal with this situation? Or it's easier to work on some parameters of Sys.time() or another R function, i suppose specifying something like timezone="Europe/Amsterdam"?

Thanks


Solution

  • Something like:

    d <- Sys.time()
    d
    [1] "2020-07-03 11:51:22 BST"
    lubridate::with_tz(d, tzone="EST")
    [1] "2020-07-03 05:51:22 EST"