Join Kevin Skoglund for an in-depth discussion in this video Create the form, part of Easy PHP Projects: Time Zone Conversion.
- [Voiceover] Now that we covered the basics…of how date and time work…we're ready to dive into our first PHP project.…We're going to create a form to allow users…to select their preferred time zone from a list.…User geolocation is a huge and complicated topic.…Sometimes you can use the current IP address…in order to determine a user's location.…But that can also be unreliable at times.…Some smartphones will send their GPS location…but that usually requires consent from the user…which many users won't give.…And sometimes, a user may be travelling…but prefer to keep features on a website…focused on their home location…even if their IP address or GPS location…reports something different.…
Unless you actually need a user's latitude and longitude…to precisely locate them,…I think the best alternative is to offer…to let a user specify their own preferences.…In this case, let them pick their preferred time zone…from a list of time zones.…This time zone selection form…is useful in many PHP projects.…You could add it to your standard user registration process.…
- Understanding the history and purpose of time zones
- Setting a default time zone in PHP
- Using the PHP DateTime and DateTimeZone classes
- Working with daylight saving time transitions
- Allowing users to select their time zone
- Displaying times in the user's preferred time zone
- Calculating the current times of major cities
- Creating a complete time zone calculator
Skill Level Beginner
1. About Time Zones
2. Default Time Zone
3. Working with Time Zones in PHP
4. User Time Zone Selection
5. Respect the User's Time Zone
6. Current World Times
7. Time Zone Calculator
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.