PHP
  Home arrow PHP arrow Page 5 - Working with Dates and Times in PHP
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Working with Dates and Times in PHP
By: Hermawan Haryanto
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 11
    2003-03-07

    Table of Contents:
  • Working with Dates and Times in PHP
  • First Step
  • Display it to human readable date and time format
  • Make my own date time
  • Another method
  • My own Language

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    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

    More PHP Articles
    More By Hermawan Haryanto


       · Thank you for this great article! I would like to share the list of human readable...
     

    PHP ARTICLES

    - 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
    - PHP Frontend to ImageMagick
    - Using PEAR's mimeDecode Module
    - Incoming Mail and PHP







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway