php current date
# Current date
date_default_timezone_set('Asia/Kolkata');
echo date("Y-m-d H:i:s");
# Current Time
date_default_timezone_set("America/New_York");
echo "The time is " . date("h:i:sa");
php current date
# Current date
date_default_timezone_set('Asia/Kolkata');
echo date("Y-m-d H:i:s");
# Current Time
date_default_timezone_set("America/New_York");
echo "The time is " . date("h:i:sa");
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.";
?>
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