ropg / ezTime

ezTime — pronounced "Easy Time" — is a very easy to use Arduino time and date library that provides NTP network time lookups, extensive timezone support, formatted time and date strings, user events, millisecond precision and more.
MIT License
327 stars 92 forks source link

Use ip-api.com to fetch timezone offsets more accurately? #175

Open scottchiefbaker opened 6 months ago

scottchiefbaker commented 6 months ago

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/
ropg commented 6 months ago

I get "Access to ip-api.com was denied / You don't have authorization to view this page." when I click that.

On Dec 18, 2023, at 17:31, Scott Baker @.***> wrote:

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: curl http://ip-api.com/json/

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

scottchiefbaker commented 6 months ago

I wonder if it's GeoLocked? Their documentation doesn't say anything about that though.

It's really great, simple API. Been around since 2012, so I don't think it's going anywhere.

ropg commented 6 months ago

Hah, works now, although I did get the error once more. Odd. But yes, I agree this is a better way to go than having our own server for this.