Acquiring Date Information with getdate() : getdate « Development « PHP






Acquiring Date Information with getdate()

<html>
<head>
<title>Acquiring date information with getdate()</title>
</head>
<body>
<?php
$date_array = getdate(); 
foreach ( $date_array as $key => $val ){
    print "$key = $val<br>";
}
?>
<hr>
<?
print "Today's date: $date_array[mday]/$date_array[mon]/$date_array[year]<p>";
?>
</body>
 </html>

           
       








Related examples in the same category

1.getdate(): Seconds past the minutes
2.getdate(): Minutes past the hour
3.getdate(): Hours of the day
4.getdate(): Day of the month
5.getdate(): Day of the week
6.getdate(): Month of the year
7.getdate(): Year (4 digits)
8.getdate(): Day of year
9.getdate(): Day of the week (name)
10.getdate(): Month of the year (name)
11.getdate(): Timestamp