how to get timestamp from date string in php code example
Example 1: php datetime to timestamp
$time = '2021-03-31 23:59:00';
strtotime($time);
Example 2: php datetime from timestamp
$ts = 1171502725;
$date = new DateTime("@$ts");
$time = '2021-03-31 23:59:00';
strtotime($time);
$ts = 1171502725;
$date = new DateTime("@$ts");