> How do get server date using PHP ~ Online tutorial

How do get server date using PHP

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:



Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

2 comments:

Unknown said...

$date = $time['day'];
=>
$date = $time['mday'];

";

print_r($time);
?>

Unknown said...

$date = $time['day'];
should be:
$date = $time['mday'];

";

print_r($time);
?>