fix undefined variable error for tzname()
fix format string
remove duplicate class definition
Merge pull request #1512

Review by @atnnn and @tryneus

Closes #1512