<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="164701" data-post-id="164701">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mathieuprog" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mathieuprog/120/16860_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mathieuprog
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="hauleth" data-post="10" data-topic="29358">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/48/18942_2.png" class="avatar"> hauleth:</div>
<blockquote>
<p>have You tried using the <code>persistent_term</code> instead of compiling modules? I know that changes there will be expensive (almost as expensive as runtime-recompilation)</p>
</blockquote>
</aside>
<p>What possible advantages do you see using <code>persistent_term</code> over compiling into maps and recompilation?</p>
<aside class="quote no-group" data-username="axelson" data-post="11" data-topic="29358">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/axelson/48/26351_2.png" class="avatar"> axelson:</div>
<blockquote>
<p>does tz work without access to a local directory?</p>
</blockquote>
</aside>
<p>Yes. At runtime it does not access the file system (only during compilation). And thank you for sharing that limitation of <code>escript</code>, let’s always take that into account when new ideas come up.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="164701" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tz-time-zone-support-for-elixir-alternative-to-tzdata-that-comes-with-a-lot-of-bugfixes/29358/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-164701" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="164701"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="164709" data-post-id="164709">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="NobbZ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/NobbZ/120/27235_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  NobbZ
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="mathieuprog" data-post="12" data-topic="29358">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mathieuprog/48/16860_2.png" class="avatar"> mathieuprog:</div>
<blockquote>
<p>What possible advantages do you see using <code>persistent_term</code> over compiling into maps and recompilation?</p>
</blockquote>
</aside>
<p>Well, simplified persistent term does exactly this. Recompile a module. But using pattern matching on function heads, rather than using a function that select from a map.</p>
<p>So as I’m not aware how your current implementation looks like, changing to persistent term might increase lookup performance while still being easily updatable at runtime.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="164709" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tz-time-zone-support-for-elixir-alternative-to-tzdata-that-comes-with-a-lot-of-bugfixes/29358/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-164709" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="164709"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="164723" data-post-id="164723">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hauleth" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/120/18942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hauleth
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>There is one disadvantage though - it need to be done on each startup, while precompiled module can be, well, precompiled <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="164723" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tz-time-zone-support-for-elixir-alternative-to-tzdata-that-comes-with-a-lot-of-bugfixes/29358/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-164723" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="164723"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="164726" data-post-id="164726">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="NobbZ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/NobbZ/120/27235_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  NobbZ
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Oh, I though we were talking about a runtime-recompiled module…</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="164726" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tz-time-zone-support-for-elixir-alternative-to-tzdata-that-comes-with-a-lot-of-bugfixes/29358/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-164726" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="164726"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="164727" data-post-id="164727">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hauleth" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/120/18942_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hauleth
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The point is that you can do both in BEAM - have precompiled module and then recompile it when needed. So it was more out of interest rather that being useful in the implementation. However recompiling the module with the <code>tz</code> which would use patter matching instead of map lookup should be the nicest solution out there.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="164727" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tz-time-zone-support-for-elixir-alternative-to-tzdata-that-comes-with-a-lot-of-bugfixes/29358/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-164727" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="164727"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="164731" data-post-id="164731">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mathieuprog" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mathieuprog/120/16860_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mathieuprog
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="hauleth" data-post="16" data-topic="29358">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hauleth/48/18942_2.png" class="avatar"> hauleth:</div>
<blockquote>
<p>use pattern matching instead of map lookup</p>
</blockquote>
</aside>
<p>can you develop that idea? <img src="https://forum.elixirforum.com/images/emoji/apple/grin.png?v=15" title=":grin:" class="emoji" alt=":grin:" loading="lazy" width="20" height="20"> currently the lookup is done by traversing the list of time zone periods (a period is a map with <code>:from</code> and <code>:to</code> entries) and checking if the timestamp (the given date for which we want to find the period) is included in the period; it’s linear, starting by the most recent period. I can optimize this by adding guards to the generated functions that return the period maps, in order to divide the periods; instead of</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def periods("Europe/Brussels")
</code></pre>
<p>have</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def periods("Europe/Brussels", timestamp) when timestamp &gt; A and timestamp &lt; B
def periods("Europe/Brussels", timestamp) when timestamp &gt; C and timestamp &lt; D
# and so on
</code></pre>
<p>Note that I think this is an optimization only for the lookup of very old dates; I wonder sometimes, who really needs that.</p>
<p>That will increase the function clauses though. Then I can also generate different function names per time zone and/or have a module per continent. There are a lot of parameters and possible optimizations.</p>
<p>However not sure what you meant by pattern matching instead of map lookup.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="164731" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tz-time-zone-support-for-elixir-alternative-to-tzdata-that-comes-with-a-lot-of-bugfixes/29358/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-164731" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="164731"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="165524" data-post-id="165524">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mathieuprog" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mathieuprog/120/16860_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mathieuprog
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Here are some major updates for <code>tz</code>:</p>
<p><strong>1. Reduced lookup time</strong></p>
<p>Testing nearly 10 million past dates on my machine took around ~430 seconds. I could reduce it to ~260 seconds. In the previous version, periods were looked up linearly as they were simply stored in a list. In the current version, this list of periods has been divided into a map, grouped by year. The data grew larger but I could keep the compilation time relatively low, by compiling the periods into modules per area as <a class="mention" href="/u/josevalim" rel="nofollow">@josevalim</a> suggested  (one module for “Europe/”-time zones, “Asia/”-time zones, etc.).<br>
(Note that I tried to work with function clauses instead, but either compilation was too slow, or after decreasing clauses, lookup was slower, or it led to errors due to too many quoted blocks, …; changing the data structure seemed most efficient in terms of lookup/compilation time balance).</p>
<p><strong>2. Performance tweaks</strong></p>
<p>Two environment options may be given to <code>tz</code> to tweak performance.</p>
<p> → Decrease period lookup time for dates in the future:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">config :tz, build_periods_with_ongoing_dst_changes_until_year: 20 + NaiveDateTime.utc_now().year
</code></pre>
<p>Looking up periods for far-future dates for a time zone that has DST changes is expensive, as <code>tz</code> has to dynamically compute those periods. It is now possible to specify until what year periods have to be pre-compiled. This does not affect period lookup time for past periods <img src="https://forum.elixirforum.com/images/emoji/apple/+1.png?v=15" title=":+1:" class="emoji" alt=":+1:" loading="lazy" width="20" height="20">, as periods are now stored into a map grouped by year; in the previous version, this option would drastically increase lookup time for past dates, as the search was linear (i.e. the more data you added, the slower it was).</p>
<p> → Decrease compilation time by rejecting old periods that are never going to be looked up:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">config :tz, reject_time_zone_periods_before_year: 2010
</code></pre>
<p>These options have been documented in the readme file with their defaults.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="165524" data-batch-url="/posts/batch_likers">
                        7
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tz-time-zone-support-for-elixir-alternative-to-tzdata-that-comes-with-a-lot-of-bugfixes/29358/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-165524" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="165524"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="165834" data-post-id="165834">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mathieuprog" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mathieuprog/120/16860_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mathieuprog
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><strong>You want automatic updates. I listened.</strong></p>
<p><code>tz</code> comes now with optional automatic updates.</p>
<p>To enable automatic updates, add  <code>Tz.UpdatePeriodically</code>  as a child in your supervisor:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">{Tz.UpdatePeriodically, []}
</code></pre>
<p>If you do not wish to update automatically, but still wish be alerted for new upcoming IANA updates, add  <code>Tz.WatchPeriodically</code>  as a child in your supervisor:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">{Tz.WatchPeriodically, []}
</code></pre>
<p>This will simply log to your server if any update is found.</p>
<p><code>mint</code>, a <a href="https://elixir-lang.org/blog/2019/02/25/mint-a-new-http-library-for-elixir/" rel="nofollow">pure Elixir HTTP client</a>, and <code>castore</code> need be added in the dependency list.</p>
<p>This addition to the library does not slow down compilation time nor lookup time.</p>
<p><strong>How does it work? (Also, need your feedback)</strong></p>
<p>When a new available IANA tz database is found, the modules are <strong>recompiled</strong> with the new time zone data.</p>
<p>I might need some review for this piece of code:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">case :erlang.get(:elixir_compiler_pid) do
  :undefined -&gt; &amp;Task.async/1
  _ -&gt; &amp;Kernel.ParallelCompiler.async/1
end
</code></pre>
<p>I use <code>:erlang.get(:elixir_compiler_pid)</code> to know whether we are in compile-time or run-time. If compile-time, modules (per time zone area) are compiled in parallel using the function <code>Kernel.ParallelCompiler.async/1</code>. If run-time, modules are compiled in parallel using the function <code>Task.async/1</code>.</p>
<p>Modules are purged after recompilation:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">Module.create(module, contents, Macro.Env.location(__ENV__))
:code.purge(module)
</code></pre>
<p>Does this seem alright? Updates work fine for me this way.<br>
Thank you for your feedback!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="165834" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tz-time-zone-support-for-elixir-alternative-to-tzdata-that-comes-with-a-lot-of-bugfixes/29358/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-165834" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="165834"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="165836" data-post-id="165836">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="mathieuprog" data-post="19" data-topic="29358">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mathieuprog/48/16860_2.png" class="avatar"> mathieuprog:</div>
<blockquote>
<p>Does this seem alright? Updates work fine for me this way.</p>
</blockquote>
</aside>
<p>This seems generally sound, although I on the HTTP front I think your best bet is to create a <code>Tz.HTTPClient</code> behaviour and make the dependency on <code>:mint</code> and <code>:castore</code> optional. This way people can plug in their own HTTP client if they’re already using one in particular. I can’t comment on the recompilation strategy sorry.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="165836" data-batch-url="/posts/batch_likers">
                        6
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tz-time-zone-support-for-elixir-alternative-to-tzdata-that-comes-with-a-lot-of-bugfixes/29358/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-165836" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="165836"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="167058" data-post-id="167058">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mathieuprog" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mathieuprog/120/16860_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mathieuprog
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>In addition to <code>tz</code>, I provide a small tool <a href="https://github.com/mathieuprog/tz_extra" rel="noopener nofollow ugc">tz_extra</a> which allows to obtain, for each time zone, the most recent offsets, the countries observing the time zone, and other useful information. It also allow you to list all the countries (iso 3166 file provided by iana).</p>
<p>The purpose is to build time zone pickers and country pickers; for example my attempt in building a time zone picker:</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/2/6/269b90442fc4411494afb525c706431f0bd59912.png" data-download-href="https://forum.elixirforum.com/uploads/default/269b90442fc4411494afb525c706431f0bd59912" title="tz-extra" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/original/3X/2/6/269b90442fc4411494afb525c706431f0bd59912.png" alt="tz-extra" data-base62-sha1="5vxr6H2rUQHcqj8pDb84bYjuiCm" width="301" height="450"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">tz-extra</span><span class="informations">527×786 39.8 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>The data can also be automatically updated (utc/dst offset may change, country names may change, …).</p>
<p>More information in the GitHub repo’s README:<br>
<a href="https://github.com/mathieuprog/tz_extra" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/mathieuprog/tz_extra</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="167058" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/tz-time-zone-support-for-elixir-alternative-to-tzdata-that-comes-with-a-lot-of-bugfixes/29358/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-167058" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="167058"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/29358/load_more?page=3">Load more posts (27 remaining)</a>
</div></template></turbo-stream>