Answers for "php code date"

PHP
2

how to set date in php

// 1. create a date instance
$date = new DateTime;

// 2. set the date using the setDate(year, month, date) method on the
//    $date instance
$date->setDate(1999,02,19);
Posted by: Guest on April-25-2020
0

displaying dates using php code

// Output — 11:03:37 AM
echo date('h:i:s A');
 
// Output — Thursday, 11:04:09 AM
echo date('l, h:i:s A');
 
// Output — 13 September 2018, 11:05:00 AM
echo date('d F Y, h:i:s A');
 
?>
Posted by: Guest on May-16-2021

Browse Popular Code Answers by Language