Greetings Steemit friends
Task 1: (1 point)
Here’s a multiple-choice quiz (QCM) focused on PHP date and time functions, indicate the correct answer, and explain your choice.
What does the checkdate function do in PHP?
A. It formats a date into a specific string.
B. It checks if a date is valid based on the day, month, and year.
C. It returns the current timestamp.
D. It adds a period to a date field.
B: This php function checks if the day, month, and year are validated making use of the day, month, and year parameters. These parameters are integers and not strings. This function does not return the timestamp, as it strictly works on the parameters I mentioned.
What does the date function return if no timestamp is provided?
A. The system's current date and time as a formatted string.
B. The time elapsed since 1970 in seconds.
C. The timestamp for midnight of the current day.
D. A boolean value indicating whether the current date is valid.
A: The date function returns the current time based on the server's default timezone in the format 'Y-m-d'. You can only get any other formatted data if some specifications changes are done.
Which of the following is true about the mktime function in PHP?
A. It returns the current system timestamp.
B. It generates a timestamp based on provided hour, minute, second, day, month, and year values.
C. It checks the validity of a date.
D. It converts a timestamp into a human-readable string.
B: mktime makes use of the parameters hour, minute, second, day, month, and year. mktime is used to return the Unix timestamp based on the server's default timezone for both date and time.
What is the purpose of the strtotime function in PHP?
A. It formats a date according to a specific format.
B. It converts an English date string into a Unix timestamp.
C. It compares two date strings.
D. It checks if a date is in the future.
B: strtotime functions are used to convert date and time to Unix timestamps. strtotime function accepts different date formats, which are in string format, and converts for easy data input.
Task2: (3points)
Project: (6 points)
Ncin (ID number): CLT255, CLT256, CLT257, CLT258, CLT259, CLT260, CLT261
Give it a try
Week 6: Leisure equipment rental service
Part 1
Part 2
Part 2
Upvoted! Thank you for supporting witness @jswit.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit