php today date
<?php
echo "Today is " . date("Y/m/d") . "<br>";
echo "Today is " . date("Y.m.d") . "<br>";
echo "Today is " . date("Y-m-d") . "<br>";
echo "Today is " . date("l");
php today date
<?php
echo "Today is " . date("Y/m/d") . "<br>";
echo "Today is " . date("Y.m.d") . "<br>";
echo "Today is " . date("Y-m-d") . "<br>";
echo "Today is " . date("l");
php get current time and date
date("Y-n-j G:i:s");
//-->2020-10-29 23:27:15
Get the Current Date and Time in PHP
phpCopy<?php
date_default_timezone_set('Europe/Amsterdam');
$DateAndTime = date('m-d-Y h:i:s a', time());
echo "The current date and time in Amsterdam are $DateAndTime.\n";
date_default_timezone_set('America/Toronto');
$DateAndTime2 = date('m-d-Y h:i:s a', time());
echo "The current date and time in Toronto are $DateAndTime2.";
?>
Get the Current Date and Time in PHP
phpCopy<?php
$Object = new DateTime();
$Object->setTimezone(new DateTimeZone('Europe/Amsterdam'));
$DateAndTime = $Object->format("d-m-Y h:i:s a");
echo "The current date and time in Amsterdam are $DateAndTime.\n";
$Object->setTimezone(new DateTimeZone('America/Toronto'));
$DateAndTime = $Object->format("d-m-Y h:i:s a");
echo "The current date and time in Toronto are $DateAndTime.";
?>
date now php
echo date('c');
// 2015-07-27T00:00:00+02:00
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us