Lab 2.6-2.8

-Get the current date and time
-Format dates and times
-Convert a string to a date

Chapter 2 Main


1. Today is Friday, July 31, 2026

date() function used formatting args:
l (lowercase 'L') - A full textual representation of a day
F - A full textual representation of a month (January through December)
d - The day of the month (from 01 to 31)
Y - A four digit representation of a year


2. Today is Friday, July 31, 2026
2.5 Current hour is 14

Good Afternoon!

getDate() function with no args, calls for curent date via getDate associative array using indexes:
weekday - day of the week, ex Saturday
month - month name, ex March
mday - day of month, ex 2
year - year, ex 2019
hours - year, ex 11


3. There are -2769 days left in this year.

UNIX Timestamp via mktime()
args format: mktime(hour, minute, second, month, day, year, is_dst... all optional)