Implement date/time formatter with QDateTime
This was still using pre-Qt4 era code around time_t, from before Qt had proper timezone support.
Some of the time_t API is still in use externally, so this adds the necessary replacements for porting those, and then this can be removed entirely here.