In Shiny for R, why does Sys.Date () return a date in dateInput yesterday?

I have dateInputin my ui.Ras follows:

dateInput("asOfDateTime", label = "As Of", value = Sys.Date(), max = Sys.Date())

For 2015-05-15this gives dateInputa default value 2015-05-14.

However, when I run Sys.Date()the console on 2015-05-15, I get the correct value 2015-05-15.

Why is Shiny giving a date in my app yesterday?

+2
source share
1 answer

It sounds strange. Iโ€™m just starting on Brilliant, so I donโ€™t know for sure.

MAY BE

  • Timezone Maybe Sys.timezone()different on their servers?

    Have you tried formatting your time zone date?

  • Caching issue

    ? , Shinyserver {... code} . ?

value NULL (. )

. Date, yyyy-mm-dd. NULL ( ), .

.

dateInput("asOfDateTime", label = "As Of", 
                                    value = NULL, max = Sys.Date())

ShinyDateInputEG

+2

Source: https://habr.com/ru/post/1612429/


All Articles