Answers for "php datetime to month name"

PHP
1

datetime get month php

$dateTime = new DateTime();
$month = $dateTime->format('m');
Posted by: Guest on December-15-2020
0

php convert month number to name

$monthNum  = 3;
$dateObj   = DateTime::createFromFormat('!m', $monthNum);
$monthName = $dateObj->format('F'); // March
Posted by: Guest on July-06-2020

Browse Popular Code Answers by Language