Join Kevin Skoglund for an in-depth discussion in this video DST transitions, part of Easy PHP Projects: Time Zone Conversion.
- [Voiceover] We've already discussed how…daylight saving time adds another layer…of complications while working with dates and times.…Part of the reason that I strongly advocate…working with date time objects in PHP,…is because of how easy they make it…to handle daylight saving time transitions.…That's because PHP is daylight saving time aware.…In this code, you can see that…I'm first creating a new…DateTimeZone object for America/New_York.…And then, I'm creating a new DateTime object…using that timezone for March 13, 2016.…
Now, that's not an arbitrary date.…I picked that date because that's the date…in 2016 when daylight saving time starts.…It begins at 2:00 AM in the morning.…So, the date that I've created is going to be at midnight.…So I'm gonna ask it to just format,…the time for me, and show me what that is.…And what I'll get back is something like what you see…on that line that has the two slashes on it,…0:00 -05:00 for the offset from UTC,…and then EST,…which is the current abbreviation…for the time zone that I'm in.…
- 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.