Date and Time Formats Flashcards
What are 3 date formats?
Format: Y-m-d, d/m/Y, F j, Y
What are 2 time formats?
Format: H:i:s, h:i A
What does the date format
Y-m-d display?
Format: Y-m-d
Example Output: 2025-01-15
This format represents the year, month, and day.
In PHP, you can format and print dates and times using the _____ function
date()
echo date(āH:i:sā)
What does the date format
d/m/Y display?
Format: d/m/Y
Example Output: 15/01/2025
This format represents the day, month, and year.
What does the date format
F j, Y display?
Format: F j, Y
Example Output: January 15, 2025
This format represents the full month name, day, and year.
Time Format 1
Format: H:i:s
Example Output: 14:30:00
This format represents hours, minutes, and seconds in 24-hour format.
Time Format 2
Format: h:i A
Example Output: 02:30 PM
This format represents hours, minutes, and AM/PM in 12-hour format.