PHP Format date
How to format date with Vanilla PHP
Watch the full tutorial here:
php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$date = new DateTime("2025-02-22");
$createdAt = htmlspecialchars($date->format('l\,\ d M\,\ Y'));
echo "No forma date: 2025-02-22<br>";
echo "Format date: $createdAt";
?>
</body>
</html>