---
slug: "alpine-linux-timezone-jst"
title: "Changing the Timezone to JST on Alpine Linux"
description: "Here's the overview of the Japanese blog article translated into English:\n\n\"RUN apk --no-cache add tzdata \\  && cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime \\  && apk del tzdata \nor ENV TZ=Asia/Tokyo\nRUN apk --no-cache add tzdata\nWhich one to choose? Using the former along with ENV TZ= does not work properly.\""
url: "https://www.ytyng.com/en/blog/alpine-linux-timezone-jst"
publish_date: "2021-02-10T00:38:41Z"
created: "2021-02-10T00:38:41Z"
updated: "2026-02-27T10:32:56.787Z"
categories: ["Docker"]
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20230812/64360a48a4a14c3db75fb2bbebcf0995.png.webp?width=768"
has_video: false
has_music: false
video_urls: []
music_urls: []
lang: "en"
---

# Changing the Timezone to JST on Alpine Linux

<h2><span>Two Implementation Methods</span></h2>
<pre><span>RUN </span>apk <span>--</span>no-cache add tzdata \<br />  <span>&amp;&amp; </span>cp <span>/</span>usr<span>/</span>share<span>/</span>zoneinfo<span>/</span>Asia<span>/</span>Tokyo <span>/</span>etc<span>/</span>localtime \<br />  <span>&amp;&amp; </span>apk del tzdata</pre>
<p><span><br /></span><span>Alternatively</span></p>
<pre><span>ENV TZ=Asia/Tokyo<br /></span>RUN apk --no-cache add tzdata</pre>
<p><br />Choose one.</p>
<p>Combining the first method with <code>ENV TZ=</code> does not work well.</p>
<p></p>
<h2>Verification Method</h2>
<p>Check if the date command returns JST.</p>
<pre>$ date<br />Wed Feb 10 09:45:26 JST 2021</pre>
<p></p>
<h2><strong></strong>Difference</h2>
<p>The latter method leaves all time zones within the image.</p>
<p>The size is approximately 3.3 MB.</p>
<p></p>
<p>If your application uses time zones, the latter method is preferable.</p>
<h2>Verification Method in Django</h2>
<pre>./manage.py shell</pre>
<pre>&gt;&gt;&gt; from django.utils import timezone<br />&gt;&gt;&gt; timezone.now()<br />&gt;&gt;&gt; timezone.now().hour</pre>
<p></p>
<p></p>
<p></p>
<p></p>
