Random things of a random world

Sami's Page

  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

Things Learned: Docker Doesn't Inherit Timezone Info

I've been doing a lot of new stuff recently, which I should blog about, but one important thing I learned today: running ASP.NET Core website in a Docker container does not inherit timezone information from the host.

I had some DateTimes from the database (I usually use UTC anyway, but this was an older application revamped so database was in old format). It worked fine on local machine, testing, all. But when deployed it suddenly showed wrong info. Everything was in GMT.

Solution: have to set TZ environment variable correctly for the container and things started working. I will try to remember this...

Comments (1) -

  • jdr74EX1

    8/27/2020 4:01:14 AM | Reply

    486120 732820I actually like your writing style,  great  details,  thankyou  for posting  : D. 984700

Add comment

Loading