PHP Date and Time Essential Training
Offered By: LinkedIn Learning
Course Description
Overview
Learn to use the intricate and sometimes underused capabilities of PHP's date and time functions to create, format, calculate, and compare dates and times.
Need to calculate the date of the third Thursday of each month or the Friday after next? PHPâand David Powersâhave you covered. David shows how to use the intricate and sometimes underused capabilities of PHP's date and time functions, including the basic date/time formatting functions in PHP 4 and the more advanced functions introduced in PHP 5. For example, you can learn how to find and set time zones, perform date calculations that incorporate different time zones and daylight savings, and calculate the time of sunrises and sunsets. Start watching and learn how to incorporate these powerful functions into your programming arsenal.
Need to calculate the date of the third Thursday of each month or the Friday after next? PHPâand David Powersâhave you covered. David shows how to use the intricate and sometimes underused capabilities of PHP's date and time functions, including the basic date/time formatting functions in PHP 4 and the more advanced functions introduced in PHP 5. For example, you can learn how to find and set time zones, perform date calculations that incorporate different time zones and daylight savings, and calculate the time of sunrises and sunsets. Start watching and learn how to incorporate these powerful functions into your programming arsenal.
Syllabus
Introduction
- Welcome
- What you should know before watching this course
- Using the exercise files
- What's involved in storing dates and time
- How PHP handles dates and time
- Setting the default time zone
- Displaying the current date and time
- Checking that a date is valid
- Timing how long a script runs
- Using time() to end a session after a period of inactivity
- Getting a Unix time stamp for a specific date or time
- Getting a time stamp from text
- Introducing the DateTime class
- Creating a DateTime object
- Displaying the value of a DateTime object
- Extending DateTime to create a default format
- Getting the time stamp from a DateTime object
- Using a time stamp to set the date and time
- Modifying the time stamp with a date string
- Troubleshooting incorrect dates
- Setting the date and time independently
- Creating a DateTime object from a custom format
- Comparing DateTime objects
- Preserving the original date when modifying the time stamp
- Finding the correct time zone from an abbreviation
- Finding time zones by country
- Getting the time zone of a DateTime object
- Creating a DateTime object for a different time zone
- Changing a DateTime object's time zone
- Finding the time difference between locations
- Finding out when the clocks change
- Introducing the DateInterval and DatePeriod classes
- Creating a DateInterval
- Adding and subtracting dates
- Finding the difference between two dates or times
- Formatting a DateInterval
- Generating a sequence of dates at regular intervals
- Finding the third Thursday in each month
- Understanding ISO week dates
- Creating a DateTime object for an ISO week date
- Finding the ISO week date
- Finding when the sun rises and sets
- Getting more information about sunrise and sunset
- Calculating the number of daylight hours
- What's different about how dates are stored?
- Formatting a date to insert into MySQL/MariaDB
- Using separate input fields for each date part
- Using PHP to format a date retrieved from a database
- Using the MySQL DATE_FORMAT() function
- Using other MySQL date and time functions
- Goodbye
Taught by
David Powers
Related Courses
Introduction to Functional ProgrammingDelft University of Technology via edX Introduction to Office 365 Development and APIs
Microsoft via edX Web Development and Design using Wordpress
California Institute of the Arts via Kadenze Build a Basic PHP Website Course (How To)
Treehouse Web Applications for Everybody
Independent