I have a dateInput
in my ui.R
as follows:
dateInput("asOfDateTime", label = "As Of", value = Sys.Date(), max = Sys.Date())
For 2015-05-15
, this gives the dateInput
a default value of 2015-05-14
.
However, when I run Sys.Date()
in the console on 2015-05-15
, I get the correct value: 2015-05-15
.
Why does Shiny give yesterday's date inside my app?
That does sound weird. I am just starting on Shiny so do not know for sure.
COULD IT BE
Timezone?? Maybe
Sys.timezone()
is different on their servers?Have you tried formatting the date for your timezone?
Caching problem??
Could the value be cached from an old instance? But I take it you are running this within your Shinyserver{ ... code} not above. Try a rebuild in the Dashboard?
BUT HERE IS SOLUTION
Set
value
toNULL
(see helpfile)It will default to your date in your timezone.
gave me today's date