If you want to timestamp something with today's date in PHP you would use the time and date functions. The time function generates the number of seconds that have passed since January 1, 1970. The date function then translates those seconds into a more human friendly readable format.
Difficulty: Easy
Time Required: 2 mins
Here's How:
- You can generate any time in the past or future that you want. One reason you may want to do this is to create a countdown. By generating the timestamp (in seconds) in the future and subtracting the current timestamp, you can calculate how much time remains before the future date will occur.
To generate the time in the future you will use the Mktime () function.
- If you are using this for a countdown, then you do not need to translate the seconds into a human friendly format. If however, you are using mktime for another reason, you can use the date () function with mktime the same way you would have used it with time ().

