<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Time on Brian Faust</title><link>https://vacua.dev/tags/time/</link><description>Recent content in Time on Brian Faust</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 01 Jan 0001 00:00:00 +0000</lastBuildDate><atom:link href="https://vacua.dev/tags/time/rss.xml" rel="self" type="application/rss+xml"/><item><title>Global State Makes Local Reasoning Impossible</title><link>https://vacua.dev/thoughts/global-state-makes-local-reasoning-impossible/</link><pubDate>Sat, 01 Aug 2020 00:00:00 +0000</pubDate><guid>https://vacua.dev/thoughts/global-state-makes-local-reasoning-impossible/</guid><description>&lt;p&gt;A repository test created a shipment two days before &lt;code&gt;now&lt;/code&gt;, then counted
shipments between the start and end of the current month. It passed most days.
During the first two days of a month, “two days ago” belonged to the previous
month and the count became zero.&lt;/p&gt;
&lt;p&gt;Nothing in the test name mentioned a calendar boundary. Nothing in the method
signature mentioned time. The same test logic produced a different result
because its generated data moved with one more input: the instant at which the
test ran.&lt;/p&gt;</description></item><item><title>Time Zones Are Part of the Data Model</title><link>https://vacua.dev/thoughts/time-zones-are-part-of-the-data-model/</link><pubDate>Thu, 01 Jun 2017 00:00:00 +0000</pubDate><guid>https://vacua.dev/thoughts/time-zones-are-part-of-the-data-model/</guid><description>&lt;p&gt;One metering path assigns an event to a billing month after converting its
occurrence time into the account&amp;rsquo;s timezone. The same path derives its daily
usage key directly from the occurrence timestamp without that conversion.&lt;/p&gt;
&lt;p&gt;Near midnight, those two fields can disagree:&lt;/p&gt;
&lt;figure class="code-figure"&gt;
 &lt;div class="code-block" data-copy-code&gt;
 &lt;button class="copy-code" type="button" aria-label="Copy code"&gt;copy&lt;/button&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;event instant: May 31, 21:30 UTC
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;local business time: June 1, 00:30
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;billing period: June
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;stored usage date: May 31&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
 &lt;/div&gt;
&lt;/figure&gt;
&lt;p&gt;Each expression looks like a date calculation. They model different things.
The defect appears only when the difference changes a boundary.&lt;/p&gt;</description></item></channel></rss>