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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Primary resources for leap seconds:</p>
<ul>
<li><a href="https://www.iana.org/time-zones" rel="noopener nofollow ugc">IANA Time Zone Database</a> - tzdata</li>
<li><a href="https://cr.yp.to/libtai.html" rel="noopener nofollow ugc">DJB’s libtai</a> - an alternative implementation worth being noted</li>
<li><a href="https://www.iers.org/SharedDocs/News/EN/BulletinC.html" rel="noopener nofollow ugc">IERS Bulletin C (the official Leap Second announcement)</a> - updated every 6 months, mailing list subscription available (for notification)</li>
</ul>
<p>I think having an API to check out how the operating system handles the leap seconds will be useful, such as accessing the tzdata or timezone database (and the current timezone environment).<br>
OTOH, having something else than the operating system definition might be implementing the same things twice with different interpretation and might be troublesome.</p>
<p>Also, UTC is affected by the leap seconds, and not <em>absolute</em>. If you want a time sequence of monotonic increase in the same pace at all times <em>without any human society intervention</em>, TAI should be a choice. OTOH, the operating system clocks of most computers in the world are synchronized with UTC.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85663" 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/call-for-proposals-time-zone-support-in-elixir/14743/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-85663" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85663"
                     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="85664" data-post-id="85664">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>On FreeBSD, tzdata should be recompiled if the operating system configuration of being aware of handling or not handling leap seconds is changed.<br>
So tzdata is <em>not</em> orthogonal to the timezone database, and rather tzdata is <em>dependent on</em> the leap second handling definition in the operating system.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85664" 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/call-for-proposals-time-zone-support-in-elixir/14743/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-85664" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85664"
                     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="85682" data-post-id="85682">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Qqwy" data-post="11" data-topic="14743">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/qqwy/48/1349_2.png" class="avatar"> Qqwy:</div>
<blockquote>
<p>First and foremost, to ensure that the timezones can be used with <em>any</em> calendar, they will work on the<br>
<code>Calendar.iso_days</code> type:</p>
</blockquote>
</aside>
<p>This is interesting. However, we already keep the offsets in the DateTime struct in ISO seconds and we wouldn’t be able to change it due to backwards compatibility. Thoughts?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85682" 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/call-for-proposals-time-zone-support-in-elixir/14743/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-85682" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85682"
                     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="85698" data-post-id="85698">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="michalmuskala" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/michalmuskala/120/20288_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  michalmuskala
                      <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="jj1bdx" data-post="14" data-topic="14743">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jj1bdx/48/2433_2.png" class="avatar"> jj1bdx:</div>
<blockquote>
<p>I think having an API to check out how the operating system handles the leap seconds will be useful, such as accessing the tzdata or timezone database (and the current timezone environment).<br>
OTOH, having something else than the operating system definition might be implementing the same things twice with different interpretation and might be troublesome.</p>
</blockquote>
</aside>
<p>I would say that this will be up to the concrete time zone info provider library. In this way it’s outside the scope of the proposal. One possible implementation I can imagine is reading the time zone info from the operating system.<br>
That said, I agree that the leap second issue is parallel, but closely related to time zones, so the proposals could try to address both of them.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85698" 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/call-for-proposals-time-zone-support-in-elixir/14743/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-85698" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85698"
                     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="85730" data-post-id="85730">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I am looking forward to having this behaviour in the Elixir standard library - something that has been planned for a long time, and I think there was even talk about having it in Elixir version 1.4 or 1.5.</p>
<aside class="quote no-group" data-username="michalmuskala" data-post="1" data-topic="14743">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/michalmuskala/48/20288_2.png" class="avatar"> michalmuskala:</div>
<blockquote>
<p>It has broad interfaces that often return collections of data you need to further process to retrieve the desired information. This means that for many operations a lot of data needs to be copied from the supporting ets tables making the library slower than it should be.</p>
</blockquote>
</aside>
<p>This sounds like it is based on a misunderstanding.</p>
<p>The Tzdata library has a bunch of different public functions. However they are not all needed to simply do timezone calculations. For instance you can get a list of all time zones, which is useful in some situations. But for the core calculations you mostly need one function.</p>
<p>Example:</p>
<pre><code>gregorian_seconds = {{2018,01,01},{00,00,00}} |&gt; :calendar.datetime_to_gregorian_seconds()
periods = Tzdata.periods_for_time("Europe/Copenhagen", gregorian_seconds, :wall)
</code></pre>
<p>Since there is no ambiguity for that wall time this returns just one period which has the abbreviation, standard offset and UTC offset needed to make a DateTime struct.</p>
<p>Here a behaviour that is not released, but one that the Tzdata library implements:</p>
<pre><code>  @type gregorian_seconds :: non_neg_integer()
  @type time_zone_period_limit :: gregorian_seconds() | :min | :max
  @type time_zone_period :: %{
          utc_off: Calendar.utc_offset(),
          std_off: Calendar.standard_offset(),
          zone_abbr: Calendar.zone_abbr(),
          from: %{
            standard: time_zone_period_limit,
            utc: time_zone_period_limit,
            wall: time_zone_period_limit
          },
          until: %{
            standard: time_zone_period_limit,
            utc: time_zone_period_limit,
            wall: time_zone_period_limit
          }
        }

  @callback periods_for_time(Calendar.time_zone(), gregorian_seconds, :wall | :utc) :: [
              time_zone_period
            ] | {:error, :not_found}
</code></pre>
<p>Both Tzdata 0.1.x and 0.5.x versions implement that behaviour. So you can either have the newer version that can update automatically or the 0.1.x versions that require manual updates.</p>
<p>The “from” and “until” part are useful when there is a gap in wall time during e.g. “spring forward”. The “standard” part is not needed for most calculations, and I would lean towards excluding the “standard” part of from/until from a native Elixir behaviour.</p>
<p>0.1.x versions of Tzdata are using compilation of the data using macros. Once compiled and loaded, it is quite fast. The negative part of that is memory usage during compilation, but more importantly it requires compiling again whenever new data is needed. Akin to recompiling Postgrex everytime someone writes to a Postgres database.</p>
<p>About leap seconds: I also think there should be an interface/behaviour for that. Either as the same behaviour or one separate for one for time zones. Leap seconds are needed in order to verify UTC datetimes. So in order to fully support ISO8601 and UTC they are needed. And the tz database from IANA has leap second information included, so if we want to support both UTC and timezones, it makes sense to not ignore the leap second information provided.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85730" 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/call-for-proposals-time-zone-support-in-elixir/14743/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-85730" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85730"
                     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="85749" data-post-id="85749">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Qqwy" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Qqwy/120/1349_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Qqwy
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>TypeCheck Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/lau" rel="nofollow">@Lau</a> thank you for that information!</p>
<p>Does anyone know what the story is with regard to checking if the OS clock already compensates for leap seconds (and how)?</p>
<p><a class="mention" href="/u/josevalim" rel="nofollow">@josevalim</a> The fact that current datetimes already store the offset in an iso8601-format indeed means that it is a lot harder to write backwards-compatible extensions that are also calendar-agnostic. I will give this matter some thought, but it will probably difficult to keep changes both general, compatible and clean.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85749" 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/call-for-proposals-time-zone-support-in-elixir/14743/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-85749" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85749"
                     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="85752" data-post-id="85752">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="josevalim" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/120/1787_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  josevalim
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Elixir</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Qqwy" data-post="19" data-topic="14743">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/qqwy/48/1349_2.png" class="avatar"> Qqwy:</div>
<blockquote>
<p><a class="mention" href="/u/josevalim" rel="nofollow">@josevalim</a> The fact that current datetimes already store the offset in an iso8601-format indeed means that it is a lot harder to write backwards-compatible extensions that are also calendar-agnostic.</p>
</blockquote>
</aside>
<p>Well, to be fair, we could assume that they are always part of 86400. We just need to keep it in mind when doing computations to other timezones.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85752" 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/call-for-proposals-time-zone-support-in-elixir/14743/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-85752" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85752"
                     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="85755" data-post-id="85755">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Qqwy" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Qqwy/120/1349_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Qqwy
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>TypeCheck Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote group-livebook_core_team quote-modified" data-username="josevalim" data-post="20" data-topic="14743" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/josevalim/48/1787_2.png" class="avatar"> josevalim:</div>
<blockquote>
<aside class="quote no-group" data-username="Qqwy" data-post="19" data-topic="14743">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/qqwy/48/1349_2.png" class="avatar"> Qqwy:</div>
<blockquote>
<p><a class="mention" href="/u/josevalim" rel="nofollow">@josevalim</a> The fact that current datetimes already store the offset in an iso8601-format indeed means that it is a lot harder to write backwards-compatible extensions that are also calendar-agnostic.</p>
</blockquote>
</aside>
<p>Well, to be fair, we could assume that they are always part of 86400. We just need to keep it in mind when doing computations to other timezones.</p>
</blockquote>
</aside>
<p>Yes. To be exact, this is already part of the implicit contract of DateTime. I remember that we talked about the notion of day-subdivision systems in the calendar discussion topic, were multiple subdivisions (like the Hebrew and Arabic systems) are just not compatible with 86400 seconds. But since these systems both see limited use, and I presume that especially for <em>timezones</em> this is fairly uncommon (Because AFAIK – do prove me wrong – all common timezones are offset from ISO8061/UTC), it might not at all be unreasonable to keep the Elixir standard library implementation limited to ISO8601-‘<em>ish</em>’ timezones.</p>
<p>Side Note: <small>The only backward-compatible way to alter the structure that is represented that I can currently think of, would be to introduce a new struct with a new name (like ‘ProperDateTime’) that therefore no library could have written code against, which means that its implementation might be very different than the current DateTime struct. Immediate drawback: All current libraries do not work at all with this new structure.</small></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85755" 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/call-for-proposals-time-zone-support-in-elixir/14743/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-85755" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85755"
                     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 #20"></div>
  </section>
</div>
    <div class="postbit" id="85984" data-post-id="85984">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I ran some benchmarks on the compiled version of tzdata (version 0.1.201805)</p>
<p>Operating System: macOS<br>
CPU Information: Intel(R) Core™ i7-7920HQ CPU @ 3.10GHz<br>
Number of Available Cores: 8<br>
Available memory: 16 GB<br>
Elixir 1.6.4<br>
Erlang 20.3.4</p>
<pre><code>Name                                        ips        average  deviation         median         99th %
periods_for_time_for_reykjavik_tz       12.51 M      0.0800 μs   ±357.97%      0.0700 μs        0.21 μs
periods_for_time_by_utc_london           5.85 M       0.171 μs  ±2071.47%        0.20 μs        0.30 μs
periods_for_time_by_utc_cph              4.20 M        0.24 μs  ±1601.73%           0 μs           1 μs
periods_for_time_by_wall_cph             3.66 M        0.27 μs  ±1575.91%           0 μs           1 μs
</code></pre>
<p>The benchmarking tool says a median of 0 μs for some of them <img src="https://forum.elixirforum.com/images/emoji/apple/thinking.png?v=15" title=":thinking:" class="emoji" alt=":thinking:" loading="lazy" width="20" height="20"></p>
<aside class="quote no-group" data-username="Qqwy" data-post="19" data-topic="14743">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/qqwy/48/1349_2.png" class="avatar"> Qqwy:</div>
<blockquote>
<p>Does anyone know what the story is with regard to checking if the OS clock already compensates for leap seconds (and how)?</p>
</blockquote>
</aside>
<p>About the system clock and leap seconds: Different systems handle them differently. Unix time does not really support UTC. So there are different strategies to handle them: skip back a second to essentially repeat the 60th second (xx:59:59 happening twice). Or make each second slightly longer on a leap second day to compensate for the extra second.</p>
<p>I have read about some systems running on TAI instead of UTC. But from an Erlang point of view I haven’t seen anything about it handling TAI - it also uses UTC. I’m not sure but maybe if you set your system clock to run TAI instead of UTC, Erlang would think that it was UTC.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="85984" data-batch-url="/posts/batch_likers">
                        5
                      </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/call-for-proposals-time-zone-support-in-elixir/14743/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-85984" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="85984"
                     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>
    <div class="postbit" id="86087" data-post-id="86087">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ConnorRigby" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ConnorRigby/120/5964_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ConnorRigby
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Nerves Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I only skimmed this so pardon if this has been said before, or if it isn’t exactly a problem.<br>
also I use <code>timex</code> in a Nerves application, which pulls in the <code>tzdata</code> application. These are my only experiences with time libraries in Elixir other than the stdlib.</p>
<p>Firstly, i would <em>love</em> for stdlib to have timezone support, because that is the <em>only</em> reason i use/need <code>timex</code>. (I try not to use deps unless i really need them due to various constraints).</p>
<p>However, syncing the timezone database is something a little weird. <code>tzdata</code> downloads the package on a timer of some sort and writes it to disk. From what i know about the elixir stdlib, and a quick poke thru <code>:observer</code>, i don’t think there is anything else that does anything to this extent right now.</p>
<p>obviously defining a <code>@behaviour</code> as described above would alleviate this to some extent, even so i think implementing this at the stdlib level would be a little difficult and messy to cover all situations. (thinking from a Nerves point of view where the filesystem is read only, and network is not guaranteed.)</p>
<p>anyway sorry for that longwinded post, just wanted to express that blurb while this is being discussed.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="86087" 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/call-for-proposals-time-zone-support-in-elixir/14743/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-86087" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="86087"
                     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 #22"></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/14743/load_more?page=3">Load more posts</a>
</div></template></turbo-stream>