PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do you get an array of the date and time?


Sometimes you might find it useful to be able to access an array of details relating to the time and date.

To do this you use the handy getdate function, like this:

<?php
$date 
getdate();
echo 
$date['month'];//September
?>


There are a range of keys available to you in the associative array that results from calling getdate, for the full list check out the page on www.php.net - the most useful are year,month,mday,hours,minutes,seconds



Comment on this Question and Answer >>>

ASK A QUESTION

More other PHP Questions

How can I stop my PHP script timing out?

What is the difference between the while and do while loops?

Can PHP create PDF files for me?

Can I include Javascript in my PHP code?

How do I access or format the date?



Custom Search