How do get server date using PHP
In this program i will show you how do get server date and time using PHP.In PHP getdate() function is used to get date in server.Program
<?php $time = getdate(); $date = $time['day']; $month = $time['month']; $year = $time['year']; $hour = $time['hours']; $min = $time['minutes']; $sec = $time['seconds']; $current_date = "$date/$month/$year == $hour:$min:$sec"; echo "$current_date"; ?> |
Output:
2 comments:
$date = $time['day'];
=>
$date = $time['mday'];
";
print_r($time);
?>
$date = $time['day'];
should be:
$date = $time['mday'];
";
print_r($time);
?>
Post a Comment