Might be best to put this in a separate PR as it looks like the dangling end of a real tangle. The datetime stuff needs revision in any case.