[MlMt] Mail Date and UTC
Alexander Kucera
a.kucera at babylondreams.de
Wed Sep 24 04:32:32 EDT 2014
I have Ruby's date parsing working already, just on the raw date. The
existence of #date is a huge relief.
While we are on the topic of Ruby. Is there any reason all the bundles
are in Ruby? Would any language work? I am much more comfortable in
Python for example.
Alexander Kucera
\ Lighting TD & Compositor — Founder & Lead Artist at BabylonDreams
— The Foundry certified Nuke Trainer
\ Neustadt, Germany GMT +1 \ App.net: AlexK \ Skype: marvinthemartian
On 24 Sep 2014, at 10:25, Benny Kjær Nielsen wrote:
> On 23 Sep 2014, at 15:35, Alexander Kucera wrote:
>
>> I have a test email whose raw headers show the date as `Date: Tue, 23
>> Sep 2014 13:03:13 +0000` which is what is written into the variable I
>> get from MailMate. However I live in UTC+2 so the time I should be
>> putting into the log is `15:03:13`.
>>
>> MailMate displays this correctly in the UI, but passes the raw time
>> value to the bundle, which is fine I guess, but I am unable to
>> convert in in any way that makes sense due to a lack of
>> Ruby/programming knowledge.
>>
>> A little help please?
>
> You should pass the virtual `#date` value instead of the raw date of
> the message. That way you'll leave it to MailMate to generate a
> canonically formatted date instead of the numerous badly formatted
> dates used in emails.
>
> After that, you can probably make Ruby parse it and format it in any
> way you like (I haven't checked how this works in Ruby). On the
> command line, you can do it like this:
>
> date -j -f "%Y-%m-%d %T %z" "2014-01-01 10:10:10 +0000" "+%a %b %d %T
> %Y"
>
> The format strings are described in `man strftime`.
>
> --
> Benny
> _______________________________________________
> mailmate mailing list
> mailmate at lists.freron.com
> http://lists.freron.com/listinfo/mailmate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20140924/5a5e80ba/attachment-0001.html>
More information about the mailmate
mailing list