Skip to content

Commit

Permalink
More updates to A Date with Perl
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Jun 21, 2017
1 parent 319e0c2 commit a802543
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions a-date-with-perl/index.html
Expand Up @@ -255,7 +255,7 @@ <h3>Time Zone Warning</h3>
<h3>Time Zone Standards</h3>

<ul>
<li>Olson time zone database is the standard</li>
<li>IANA (née Olson) time zone database is the standard</li>
<li><a href="http://www.iana.org/time-zones">http://www.iana.org/time-zones</a></li>
<li>An open source data/software project</li>
<li>Microsoft does their own thing (of course)</li>
Expand All @@ -267,7 +267,7 @@ <h3>Time Zone 101</h3>

<ul>
<li>An offset in minutes and hours from UTC</li>
<li>Orlando is currently at -04:00</li>
<li>Washington, DC is currently at -04:00</li>
<li>Also has a name</li>
<li>Names are (mostly) continent or ocean + major city
<ul>
Expand Down Expand Up @@ -392,7 +392,7 @@ <h3>The y2.038k problem</h3>
<li>The epoch will no longer fit in a 32-bit int</li>
<li>2038-01-19T03:14:07 UTC</li>
<li>A 30-year mortgage in 2013 ends in 2043</li>
<li>As of Perl 5.12, Perl always uses a 64-bit epoch</li>
<li>As of Perl 5.12, Perl always uses a large-enough epoch</li>
</ul>
</article>

Expand Down Expand Up @@ -664,7 +664,7 @@ <h3>Storage and Presentation</h3>

<ul>
<li>Store datetimes as floating or UTC whenever possible</li>
<li>Or store them as a datetime + time zone (Pg's <code>TIMESTAMP WITH TZ</code> type)</li>
<li>Or store them as a datetime + time zone (Pgs's <code>TIMESTAMP WITH TZ</code> type)</li>
<li>Also store the named time zone if the database only stores an offset</li>
<li>Don't store an epoch, store a datetime</li>
<li>Use time zones for presentation to users</li>
Expand Down Expand Up @@ -733,26 +733,6 @@ <h3>Don't Use a Parser</h3>
</code></pre>
</article>

<article>
<h3>Don't Validate</h3>

<ul>
<li>If your data is always valid</li>
</ul>

<pre><code>local $Params::Validate::NO_VALIDATION = 1;
my $dt = DateTime-&gt;new(
year =&gt $y,
month =&gt $m,
day =&gt $d,
);
</code></pre>
</article>

<article>
<h2>Questions?</h2>
</article>

<article>
<h2>Thank You</h2>
</article>
Expand Down

0 comments on commit a802543

Please sign in to comment.