[MlMt] Mail Date and UTC

Benny Kjær Nielsen mailinglist at freron.com
Wed Sep 24 06:38:40 EDT 2014


On 24 Sep 2014, at 11:14, Alexander Kucera wrote:

> Hmm, I'm not sure #date is working correctly.
>
> I have a raw date of `Tue, 23 Sep 2014 17:38:44 -0500`, but #date 
> seems to give me the exact same thing only formatted differently. When 
> I print #date I get `2014-09-23 17:38:44 -0500` instead of `2014-09-24 
> 00:38:44 +0000` 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?

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.

Here is a variant from my previous example:

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

Here I first explicitly state that we are in zone CET (`+0100`). (I 
don't really need to do that since that is also the default *for me*.) 
The date and time is given in zone `-0500`. So, at GMT (`+0000`) the 
time would be `15:10:10`, and in zone `+0100` this would be `16:10:10`. 
This is also the result of the command above.

Time zones are confusing and daylight saving times do not make it 
easier. (I often make mistakes when dealing with time zones.)

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.

You can also use `#date-received` I believe. This is “hardcoded” to 
timezone +0000 if that makes it easier.

-- 
Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20140924/601604f9/attachment.html>


More information about the mailmate mailing list