Download the PHP package ilhamrisky/laravel-timezone-by-city without Composer
On this page you can find all versions of the php package ilhamrisky/laravel-timezone-by-city. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ilhamrisky/laravel-timezone-by-city
More information about ilhamrisky/laravel-timezone-by-city
Files in ilhamrisky/laravel-timezone-by-city
Package laravel-timezone-by-city
Short Description Laravel package to get timezone by city
License MIT
Informations about the package laravel-timezone-by-city
Laravel Timezone by City
Introduction
Laravel Get Timezone by City package provides a simple way to retrieve timezone information for cities around the world. It utilizes Carbon for date and time manipulation. This README will guide you on how to install and use the package in your Laravel project.
Data Source
The city data provided by this package is sourced from the GeoNames Gazetteer, available at GeoNames Gazetteer. GeoNames is a geographical database that covers all countries and contains over eleven million place names. As of the last update on February 16, 2024, it provides information for 146,892 cities worldwide.
Installation
Require this package with composer using the following command:
Usage
Import the namespace and instantiate the class in your Laravel controller or service
Example
Example 1: Check if a city exists in the dataset
Example 2: Get a list of all cities available in the dataset
Example 3: Get all data for a specific city
Example 4: Get the timezone for a specific city
Example 5: Get the UTC offset for a specific city
Example 6: Get the latitude and longitude for a specific city
Example 7: Get a list of cities based on their country code
Example 8: Get the current time in a specified city's timezone
Example 9: Get the city based on latitude and longitude coordinates
Example 10: Convert time between two cities' timezones
Example 11: Compare local time and city time
License (MIT License):
This package is released under the MIT License, which allows you to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software. The only condition is that the above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.
Feel free to contribute, create issues, or submit pull requests to enhance the functionality or fix any bugs.