Horje

Example of PHP Date formatting

Here is the right way to use PHP Date formatting
index.php
Example: PHP
<?php
$date = DateTime::createFromFormat('j-M-Y', '02-Jan-2024');
echo $date->format('Y-m-d');
?>

Output should be:

Example of PHP Date formatting



Single Articles
Example of PHP Date formattingPHP Time Tutorial


Related Articles
How to convert a timestamp to Minute Ago in PHP PHP Time Tutorial
How to create PHP Date formatting PHP Time Tutorial

Type:
Php
Category:
Web Tutorial
Sub Category:
PHP Time Tutorial
Uploaded by:
Admin



Share on: