Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

How do I get the current date and time in PHP?

//Your Country Time Zone: https://www.php.net/manual/en/timezones.php

date_default_timezone_get(Asia/Dhaka);

$dateYmd = date('Y-m-d');
echo "Current Year Month Day: $dateYmd";
//Current Year Month Day: 2022-01-14

$datehms = date('h:i:s');
echo "Current Hour Minute Second: $datehms";
//Current Hour Minute Second: 10:33:58
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #I #current #date #time
ADD COMMENT
Topic
Name
7+9 =