Look here.
You will see that [0] is your timestamp (seconds since unix epoch).
- // To get the year (yyyy) it's
-
echo $date['year'];
-
// Month (mm) is:
-
echo $date['mon'];
-
// Day (dd) is:
-
echo $date['mday'];
However, you should really look at the
date() function as this is probably what you are after. To do your request would be:
- $today = date("Y/m/d");
-
echo $today;
With the date() function you can put in a second parameter for inital timestamp if that's what you want. If you do not put an initial timestamp, it takes the current one.
time() will get you a current timestamp.
I have tried to tell you other ways to solve your problem, but you can use this if that's all you want:
- $date = date("Y/m/d",getdate());
-
print $date;