khsing / laravel-world

provide countries, states, and cities relations and database.
MIT License
431 stars 90 forks source link

Timezones? #29

Open wrabit opened 4 years ago

wrabit commented 4 years ago

How can we add timezone to each city?

khsing commented 4 years ago

sure, but we need data source to do this.

seche commented 3 years ago

https://download.geonames.org/export/dump/ seems like a good source. Has a few dumps for cities by population. And they all link to an IANA Timezone which is what PHP uses.

@khsing did you prefer to add a timezone field in cities or a new timezone table with abbreviation and time offsets? PHP comes with DateTimeZone::Class that handles the information as needed and I think the table might be redundant. Could easily have the functionality with a timezone trait.