How to install tzdata on a ubuntu docker image?
One line only: RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
One line only: RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
The secret here is that dpkg-reconfigure tzdata simply creates /etc/localtime as a copy, hardlink or symlink (a symlink is preferred) to a file in /usr/share/zoneinfo. So it is possible to do this entirely from your Dockerfile. Consider: ENV TZ=America/Los_Angeles RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone And as a bonus, TZ will … Read more
Append ‘UTC’ to the string before converting it to a date in javascript:
I found on the sqlite documentation (https://www.sqlite.org/lang_datefunc.html) this text: Compute the date and time given a unix timestamp 1092941466, and compensate for your local timezone. That didn’t look like it fit my needs, so I tried changing the “datetime” function around a bit, and wound up with this: That seems to work – is that … Read more
Using an offset to calculate Timezone is a wrong approach, and you will always encounter problems. Time zones and daylight saving rules may change on several occasions during a year, and It’s difficult to keep up with changes. To get the system’s IANA timezone in JavaScript, you should use Run code snippetExpand snippet As of September 2019, … Read more
Background JavaScript’s Date object tracks time in UTC internally, but typically accepts input and produces output in the local time of the computer it’s running on. It has very few facilities for working with time in other time zones. The internal representation of a Date object is a single number, representing the number of milliseconds that have elapsed since 1970-01-01 … Read more
Append ‘UTC’ to the string before converting it to a date in javascript:
Etc/UTC is the time zone whose display name is UTC. That is, they’re long and short names for the same timezone, per IANA’s time zone database.
I just found a free zip database that includes time offset and participation in DST. I do like Erik J’s answer, as it would help me choose the actual time zone as opposed to just the offset (because you never can be completely sure on the rules), but I think I might start with this, and have … Read more
On one server, when I run: On another server: