fix gmtime; closes #1366