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
[email protected]
http://lists.freron.com/listinfo/mailmate