Join Kevin Skoglund for an in-depth discussion in this video Create hour selector, part of Easy PHP Projects: Time Zone Conversion.
- [Voiceover] In the previous movie we used…array map in order to create a list of all of the…minutes while using a function to format those minutes.…We're going to do that here as well…when working with the hours.…The idea that I have for the hour option format…is that we're going to have the hour displayed…in both 24 hour time and in 12 hour time.…24 hour time is pretty straightforward, right.…Every hour is uniquely identified by a number…from zero up to 23.…
The only thing is we have to make sure that we pad…the left side of those numbers if they're less than 10.…We saw how to do that in the last movie,…it's exactly the same.…So we could do that with no problem.…However, I think that that is not the way…that most people think of time.…I think that more people use 12 hour time…and they think of 12 am, instead of 00 for the hour.…So, for the format, for the select option people can choose,…I want to provide a slash, and then provide…the 12 hour time after it.…Saying the number from one to 12…and then whether it's am or pm.…
- 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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.