In PHP, if we want to convert a date into a timestamp, we can directly use the strtotime function. If we want to convert a timestamp into a date, we can directly use the date() function. Let me introduce it to my friends.
strtotime() function The strtotime() function parses the date-time description of any English text into a Unix timestamp.
Example
The code is as follows
|
Copy code
$a = date();
echo(strtotime("+5 hours")); $time = time();
echo(strtotime("next Monday"));
1138632504
1139180400 The above is to convert the |