<div class="markdown">
<p dir="auto">Ah, I see. Time to dive into the depths of timezone conversion then I guess.</p>

<p dir="auto">Thanks Benny.</p>

<p dir="auto">Alexander Kucera<br>
\ Lighting TD & Compositor — Founder & Lead Artist at BabylonDreams — The Foundry certified Nuke Trainer<br>
\ Neustadt, Germany GMT +1 \ App.net: AlexK \ Skype: marvinthemartian</p>

<p dir="auto">On 24 Sep 2014, at 12:38, Benny Kjær Nielsen wrote:</p>

<blockquote>
<p dir="auto">On 24 Sep 2014, at 11:14, Alexander Kucera wrote:</p>

<blockquote>
<p dir="auto">Hmm, I'm not sure #date is working correctly.</p>

<p dir="auto">I have a raw date of <code>Tue, 23 Sep 2014 17:38:44 -0500</code>, but #date seems to give me the exact same thing only formatted differently. When I print #date I get <code>2014-09-23 17:38:44 -0500</code> instead of <code>2014-09-24 00:38:44 +0000</code> which MailMate shows me. So I still would need to do some timezone script foo to get my log entries straight. Or did I maybe not understand the purpose of #date correctly?</p>
</blockquote>

<p dir="auto">The purpose is that your scripting language should be able to parse this date without problems. Since the time zone is included then the date and time is non-ambiguous. You should then use the scripting language to format the date according to the local time zone.</p>

<p dir="auto">Here is a variant from my previous example:</p>

<pre><code>TZ=CET date -j -f "%Y-%m-%d %T %z" "2014-01-01 10:10:10 -0500" "+%a %b %d %T %Y"
</code></pre>

<p dir="auto">Here I first explicitly state that we are in zone CET (<code>+0100</code>). (I don’t really need to do that since that is also the default <em>for me</em>.) The date and time is given in zone <code>-0500</code>. So, at GMT (<code>+0000</code>) the time would be <code>15:10:10</code>, and in zone <code>+0100</code> this would be <code>16:10:10</code>. This is also the result of the command above.</p>

<p dir="auto">Time zones are confusing and daylight saving times do not make it easier. (I often make mistakes when dealing with time zones.)</p>

<p dir="auto">There is no virtual header available for the current time zone. If there were then it would have to be dynamic (not cached/saved to disk) in the event that you were travelling between time zones.</p>

<p dir="auto">You can also use <code>#date-received</code> I believe. This is “hardcoded” to timezone +0000 if that makes it easier.</p>

<p dir="auto">-- <br>
Benny</p>

<hr>

<p dir="auto">mailmate mailing list<br>
<a href="mailto:mailmate@lists.freron.com">mailmate@lists.freron.com</a><br>
<a href="http://lists.freron.com/listinfo/mailmate">http://lists.freron.com/listinfo/mailmate</a></p>
</blockquote>

</div>