tidyverse / lubridate

Make working with dates in R just that little bit easier
https://lubridate.tidyverse.org
GNU General Public License v3.0
728 stars 207 forks source link

`stamp` returning correct output in macOS but not in Docker #714

Open markhwhiteii opened 6 years ago

markhwhiteii commented 6 years ago

I am using lubridate::stamp in a Shiny app that I am deploying using a Docker container. The base image I am using is rocker/shiny: https://hub.docker.com/r/rocker/shiny/~/dockerfile/

When I run the app locally, I get, for example:

> stamp("Jan 1", "%Ob %d", locale = "en_US.UTF-8")(ymd("2018-09-10"))
Using: "%Ob %d"
[1] "Sep 10"

However, when I run the app in the Docker container, stamp("Jan 1", "%Ob %d", locale = "en_US.UTF-8")(ymd("2018-09-10")) written into my app gives me "%Ob 10"

vspinu commented 6 years ago

Probably obvious, but are versions of lubridate on both machines the same?

markhwhiteii commented 6 years ago

Yes, 1.7.4

vspinu commented 6 years ago

Hmm. That means locale is not propagated correctly. Will have a look when time comes but not very soon unfortunately. Loaded with tons of stuff atm.

Do you really need Ob format? Or b would work just fine?

You can also try multiple format sets like stamp("Jan 1", c("bd", "Obd"), locale = "en_US.UTF-8"))

markhwhiteii commented 6 years ago

I get the same thing when trying multiple format sets. I switched to Bd for now, which somehow works just fine. No worries, I'm sure other things are more important, but I thought I'd rase the issue nonetheless.

hadley commented 4 years ago

Now tracking all localisation issues in #815