Join Kevin Skoglund for an in-depth discussion in this video Time zone options function, part of Easy PHP Projects: Time Zone Conversion.
- [Voiceover] In this movie,…we're going to write a function,…which will make it easy for us to output an option list…of the timezones supported by PHP.…We have our HTML form all ready…and we have two places where we want to output…a list of the timezones as select options.…For the from timezone that we're picking…and also, the "to timezone,"…the target that we're picking.…So for both of those, we wanna have a select option list.…We've generated this select option list before.…We did it back in Chapter Four.…And you can go back to that work that we did,…or you can look in the exercise files in order to find it.…
I'm gonna go back here,…and let's go to "timezone selection."…Then I'm gonna open up index.php.…Here's the code right here…for that timezone output,…for outputting those selections.…Everything from right below select,…all the way to right above select.…So I'm gonna copy that.…I'm just gonna switch by over,…and I could paste that code in right here,…and also, right here again.…But if I did, I'd be repeating myself…
- 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.