mu sexp date format

8 views
Skip to first unread message

Norman Köhring

unread,
Jul 19, 2016, 10:50:02 AM7/19/16
to mu-discuss
Dear Mu folks,

I use --format=sexp and try to interpret the output, as the XML output doesn't contain all the important information (is that format abandonded?)

Now I wonder about the used date format, for example
(22369 17209 0)

which results in
Wed 15 Jun 2016 01:59:53 PM CEST


What kind of format is that? I'm not experienced in Lisp and a short research didn't help at all.


Thanks
Norman

Norman Köhring

unread,
Jul 19, 2016, 11:42:59 AM7/19/16
to mu-discuss
Meanwhile looked at the source code I found that it is just a unix timestamp split into two 16bit values.

(22369 << 16) + 17209 = 1465991993

Why?

Dirk-Jan C. Binnema

unread,
Jul 19, 2016, 12:45:22 PM7/19/16
to mu-di...@googlegroups.com
Hi Norman,

On Tuesday Jul 19 2016, Norman Köhring wrote:

> Meanwhile looked at the source code I found that it is just a unix
> timestamp split into two 16bit values.
>
> (22369 << 16) + 17209 = 1465991993
>
> Why?

It's bit curious, isn't it? It's the format emacs uses for time-stamps;
even on 32-bit platforms, emacs' integers only go up to 29 bit (they use
the other bits for tagging), so a time_t values must be split.

This allows mu4e to interpret these expressions somewhat like emacs'
(current-time).


> Am Dienstag, 19. Juli 2016 16:50:02 UTC+2 schrieb Norman Köhring:
>>
>> Dear Mu folks,
>>
>> I use --format=sexp and try to interpret the output, as the XML output
>> doesn't contain all the important information (is that format
>> abandonded?)

The built-in XML always was a bit limited.

But there's a tool mu-sexp-convert (in contrib/ in the source directory)
which can convert the sexps to either xml or json.

Cheers,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

Norman Köhring

unread,
Jul 20, 2016, 6:01:02 AM7/20/16
to mu-discuss
Am Dienstag, 19. Juli 2016 18:45:22 UTC+2 schrieb djcb:
Hi Norman,

On Tuesday Jul 19 2016, Norman Köhring wrote:

> Meanwhile looked at the source code I found that it is just a unix
> timestamp split into two 16bit values.
>
> (22369 << 16) + 17209 = 1465991993
>
> Why?

It's bit curious, isn't it? It's the format emacs uses for time-stamps;
even on 32-bit platforms, emacs' integers only go up to 29 bit (they use
the other bits for tagging), so a time_t values must be split.


Interesting! In the end I thought it would be a limitation on the transport layer. Thanks for the explanation.
 
This allows mu4e to interpret these expressions somewhat like emacs'
(current-time).


> Am Dienstag, 19. Juli 2016 16:50:02 UTC+2 schrieb Norman Köhring:
>>
>> Dear Mu folks,
>>
>> I use --format=sexp and try to interpret the output, as the XML output
>> doesn't contain all the important information (is that format
>> abandonded?)

The built-in XML always was a bit limited.

But there's a tool mu-sexp-convert (in contrib/ in the source directory)
which can convert the sexps to either xml or json.

Oh this is super helpful! Thanks a lot!
 
Cheers,
Dirk.

Cheers,
Norman
 
--
Dirk-Jan C. Binnema                  Helsinki, Finland
Reply all
Reply to author
Forward
0 new messages