xxxxxxxxxx
$date = new DateTime();
echo $date->getTimestamp();
xxxxxxxxxx
<?php
// Get current Unix timestamp
$timestamp = time();
// Convert Unix timestamp to date and time
$date = date('Y-m-d H:i:s', $timestamp);
// Output the results
echo "Current Unix timestamp: " . $timestamp . "\n";
echo "Date and time: " . $date . "\n";
?>