Author
Updated
7/8/2016Released
3/3/2015- How PHP handles dates and time
- Setting the default time zone
- Displaying current date and time
- Getting a timestamp from text
- Using the DateTime class
- Getting and modifying a timestamp from DateTime
- Comparing DateTime objects
- Working with time zones
- Using DateInterval and DatePeriod
- Finding ISO week dates
- Calculating sunrise and sunset
Skill Level Intermediate
Duration
Views
- [Voiceover] Hi, I'm David Powers. Welcome to PHP Date and Time Essential Training. PHP has an impressive set of tools designed to take the hard work out of dealing with dates and time. After considering the problems of working with dates and time zones, we'll look at the basic functions inherited from PHP 4, for formatting and creating dates. Then we'll embark on an in depth exploration of the more sophisticated date and time related classes introduced in PHP 5.
You'll learn how to find and set the correct time zone and perform date calculations that automatically take different time zones and daylight saving time into consideration. I'll show you how to find out when the clocks next change in different parts of the world; and how to calculate the time of sunrise and sunset. Need to work out the date of the third Thursday of each month? No problem. PHP has it covered. There's a lot to do, so let's dive straight into PHP Date and Time Essential Training.
Q: How does calculating sunrise and sunset (as shown in chapter 7) work for locations north of the Arctic Circle?
A: In polar regions, date_sun_info() reports the value for sunrise and sunset as 1 on days when the sun never sets. The values are empty for days when the sun never rises.
Related Courses
-
PHP: Creating Secure Websites
with Kevin Skoglund4h 15m Intermediate -
PHP: Accessing Databases with PDO and MySQLi
with David Powers3h 47m Intermediate
-
Introduction
-
Welcome1m 2s
-
Using the exercise files3m 10s
-
-
1. Handling Dates and Times in PHP
-
2. Basic Date and Time Functions
-
3. Using the DateTime class
-
Creating a DateTime object4m 27s
-
4. Working with Time Zones
-
5. Using the DateInterval and DatePeriod classes
-
Creating a DateInterval4m 12s
-
Adding and subtracting dates4m 44s
-
Formatting a DateInterval5m 32s
-
6. Working with ISO Week Dates
-
Understanding ISO week dates2m 57s
-
Finding the ISO week date4m 24s
-
-
7. Calculating Sunrise and Sunset
-
8. Dates and Databases
-
Conclusion
-
Goodbye1m 56s
-
- 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: Welcome