I've had really good luck using ip-api.com to fetch timezone offsets. They offer simple newline support:
# Get the TZ offset for the requesting IP
curl http://ip-api.com/line/?fields=offset
Or full featured JSON if needed as well:
# Get information about the requesting IP
curl http://ip-api.com/json/