Home arrow PHP arrow Page 5 - Working with Dates and Times in PHP
PHP

Working with Dates and Times in PHP


In this article Hermawan will teach you how to work with the date and time functions in PHP in a way such that your site will not suffer from jet lag.

Author Info:
By: Hermawan Haryanto
Rating: 4 stars4 stars4 stars4 stars4 stars / 18
March 07, 2003
TABLE OF CONTENTS:
  1. · Working with Dates and Times in PHP
  2. · First Step
  3. · Display it to human readable date and time format
  4. · Make my own date time
  5. · Another method
  6. · My own Language

print this article
SEARCH DEVARTICLES

Working with Dates and Times in PHP - Another method
(Page 5 of 6 )

This is another method to access the current date or the given timestamp that you've produced by your own script. The method, or you can call it function, is getdate(). This function will produce an associative array containing the date information. The array key is:

"seconds" - seconds
"minutes" - minutes
"hours" - hours
"mday" - day of the month
"wday" - day of the week, numeric: from 0 as Sunday up to 6 as Saturday
"mon" - month, numeric
"year" - year, numeric
"yday" - day of the year, numeric; i.e. "299"
"weekday" - day of the week, textual, full; i.e. "Friday"
"month" - month, textual, full; i.e. "January"

Example :

$today = getdate();
print $today["month"] // it will print the month of current date
print $today["weekday"] // it will print the day of current date


blog comments powered by Disqus
PHP ARTICLES

- Removing Singletons in PHP
- Singletons in PHP
- Implement Facebook Javascript SDK with PHP
- Making Usage Statistics in PHP
- Installing PHP under Windows: Further Config...
- File Version Management in PHP
- Statistical View of Data in a Clustered Bar ...
- Creating a Multi-File Upload Script in PHP
- Executing Microsoft SQL Server Stored Proced...
- Code 10x More Efficiently Using Data Access ...
- A Few Tips for Speeding Up PHP Code
- The Modular Web Page
- Quick E-Commerce with PHP and PayPal
- Regression Testing With JMeter
- Building an Iterator with PHP

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials