Join Kevin Skoglund for an in-depth discussion in this video Convert the time zone, part of Easy PHP Projects: Time Zone Conversion.
- View Offline
- Exercise Files
- [Voiceover] Now that our conversion form…has the time zone choices we need.…We're ready to write the PHP for processing the form…and for converting the submitted time…from one time zone into another.…So on my index.php page, I wanna jump up to the very top…and right here in the PHP, after we require the functions,…let's write our processing code.…So we're only gonna do this, if the form has been submitted…and the way I like to do that is using that POST superglobal…and look for submit.…If we have submit, then we know that…that submit button was clicked,…and that's because our submit button…has name="submit" with a value.…
If we see that name there,…if there's a value and that's been set,…isset, there we are, then we'll know…that this form has been submitted to us.…Okay, so, then once we have the form…let's grab those values out of there.…We have the from time that should be coming in as…$_POST['from_time'].…I'm just gonna copy that line two more times,…because we have another one that is from_tz…and another one that is to_tz.…
- 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.