[ Team LiB ] Previous Section Next Section

Workshop

Quiz

1:

How would you acquire a Unix timestamp representing the current date and time?

2:

Which function accepts a timestamp and returns an associative array representing the given date?

3:

Which function would you use to format date information?

4:

How would you acquire a timestamp for an arbitrary date?

5:

Which function could you use to check the validity of a date?


Answers

A1:

The time() function returns the current date in timestamp format.

A2:

The getdate() function returns an associative array whose elements contain aspects of the given date.

A3:

The date() function is used to format a date.

A4:

Given arguments representing the hour, minute, second, month, day of month, and year, the mktime() function returns a Unix timestamp.

A5:

You can check a date with the checkdate() function.


    [ Team LiB ] Previous Section Next Section