glhd / laravel-timezone-mapper
Timezone mapper for Laravel
1.5.0
2026-03-23 18:11 UTC
Requires
- php: >=8.1
- illuminate/support: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.93
- mockery/mockery: ^1.6
- orchestra/testbench: ^6.24|^7.10|^8.33|^9.17|^10.11|^11.0|12.x-dev
- phpunit/phpunit: ^12.5|^13.0
README
This package maps coordinates to a timezone string. Based heavily on TimezoneMapperPHP and LatLongToTimezone and adopted for use in a Laravel project.
It's not likely to be 100% correct every time, but if you need to map lots of coordinates and don't want to make API calls each time, it's a good way to get reasonable defaults.
Usage:
$mapped_timezone = TimezoneMapper::mapCoordinates( latitude: 51.50853, longitude: -0.12574, fallback: 'America/New_York', // Optional -- used if unable to map coords ); // Returns "Europe/London"