Join Kevin Skoglund for an in-depth discussion in this video Create minute selector, part of Easy PHP Projects: Time Zone Conversion.
- [Voiceover] In this previous movie we created…a generic function that proved to be really useful…when creating options for our date selections.…Over the course of the next two movies…we're going to build on that work…and create select options for the time selectors…starting with the minute options.…We'll come back to the hours in a moment.…First we're going to start with the minutes.…That's because it's a little bit simpler…to work with the minutes.…Minutes is just going to be a range of numbers…from 0 up to 59.…The only catch, the only thing that makes…this difficult, is that the values for the numbers…are going to be the numbers 0 to 59…but the labels that we want on them…that the user is going to see…need to be 0 padded on the left side.…
That is 00, instead of just 0, 01 instead of just 1.…So if the number is less than 10…we're going to need to put a 0 on the left side.…Now you could just write some basic PHP code…that would loop through all of these numbers…covert each one of them into a string…and if the number was less than 10…
Author
Released
3/11/2016- 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
Duration
Views
Related Courses
-
Code Clinic: PHP
with David Powers4h 44m Intermediate -
PHP: Creating Secure Websites
with Kevin Skoglund4h 15m Intermediate
-
Introduction
-
Welcome56s
-
-
1. About Time Zones
-
History6m 36s
-
UTC and time zone offsets3m 33s
-
-
2. Default Time Zone
-
PHP time zone identifiers6m 18s
-
Set default in php.ini6m 8s
-
Set default at runtime4m 49s
-
-
3. Working with Time Zones in PHP
-
Understanding Unix time2m 39s
-
PHP procedural functions6m 22s
-
PHP DateTime6m 20s
-
PHP DateTimeZone7m 17s
-
DST transitions9m 1s
-
-
4. User Time Zone Selection
-
Create the form5m 23s
-
Include the time zone offset4m 27s
-
-
5. Respect the User's Time Zone
-
Display the current time3m 19s
-
Convert to user's time zone4m 45s
-
Store dates in a database2m 44s
-
-
6. Current World Times
-
List time zones4m 30s
-
Solution: Use major cities3m 12s
-
Sort cities by offset5m 53s
-
More efficient sorting6m 43s
-
-
7. Time Zone Calculator
-
Create the form4m 9s
-
Time zone options function4m 47s
-
Convert the time zone7m 40s
-
Create date selectors9m 39s
-
Create minute selector5m 30s
-
Create hour selector6m 28s
-
-
Conclusion
-
Next steps32s
-
- 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.
CancelTake 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.
Share this video
Embed this video
Video: Create minute selector