Use the property kernel mechanism for date <-> struct conversion

This simplifies the code, and hopefully fixes a crash
in this code on some Linux platforms