Parse struct tm ourselves.

This way, we don't need tm_gmtoff, which we would otherwise need to
adjust the value parsed by mktime, and don't need timegm either.