This Screenshot Date Time My Laptop..
This Screenshot My Script Result
This My Syntax
<?php
session_start();
$time = date('Y-m-d, H:i:s');
echo $time;
?>
Why not same.. Please Help Me.. Sorry My English Language Is Bad And I'm Newbie
This Screenshot Date Time My Laptop..
This Screenshot My Script Result
This My Syntax
<?php
session_start();
$time = date('Y-m-d, H:i:s');
echo $time;
?>
Why not same.. Please Help Me.. Sorry My English Language Is Bad And I'm Newbie
here is something you need to see ....
<?php
$date = new DateTime('2000-01-01', new DateTimeZone('Pacific/Nauru'));
echo $date->format('Y-m-d H:i:sP') . "\n";
$date->setTimezone(new DateTimeZone('Pacific/Chatham'));
echo $date->format('Y-m-d H:i:sP') . "\n";
?>
PHP 5.1 returns the time of the SERVER, which can be anywhere in the world.
Your computer displays your LOCAL time (or whichever time zone you set it up as, typically your local time zone).
Use Milos' solution to tell PHP what timezone you want to use. But many people will recommend using a timeserver for 100% accuracy, as your Server (as well as your computer) may not be set correctly itself.
See http://www.kloth.net/software/timesrv1.php for timeserver examples.
Please try this.
<?php
$date_time = new DateTime();
echo $date_time->format('Y-m-d H:i:s');
?>