Miscellaneous
  Home arrow Miscellaneous arrow Page 4 - Working with dates and times in PHP
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Forums Sitemap 
Dedicated Servers  
Download TestComplete 
JMSL Numerical Library 
IBM® developerWorks
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? 
MISCELLANEOUS

Working with dates and times in PHP
By: Hermawan Haryanto
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2002-11-12

    Table of Contents:
  • Working with dates and times in PHP
  • Human Readable Formats
  • Making your own date and time
  • 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 - My own Language


    (Page 4 of 4 )

    By this time I hope you can create your own date and time using the timestamp of the current date or your own timestamp. I’m not using English as my primary language, and neither are my website users. We are from Indonesia and I want to display the date in Indonesian language. How can I do it? That’s a perfect question and asked by most beginners.

    Let’s create an associative array of date and month in our own language.

    <?php
    $days 
    = Array ("Minggu""Senin""Selasa""Rabu""Kamis""Jum’at""Sabtu");
    $months = Array (1=>"Januari",
                     
    2=>"Pebruari",
                     
    3=>"Maret",
                     
    4=>"April",
                     
    5=>"Mei",
                     
    6=>"Juni",
                     
    7=>"Juli",
                     
    8=>"Agustus",
                     
    9=>"September",
                     
    10=>"Oktober",
                     
    11=>"Nopember",
                     
    12=>"Desember");
    ?>

    After we create our own language of date and months, now it’s time to display it.

    <?php
    print $days[date("w")]; // display name of day with our own language
    print $months[date("n")];
    ?>

    Ok guys, that’s it for today. We’ll see you again next time.

    About the Author

    Hermawan Haryanto is a Web Application Developer with over seven years of Website development experience; provide web application development services internationally. Holds the position of IT Director on his own small and fast growth company, dMonster.com, where he is also the primary Web Developer. His knowledge of Web Application extends into PHP, MySQL, ASP, SQL Server, PostgreSQL & JavaScript.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · get me date function of today's in the php language
     

    MISCELLANEOUS ARTICLES

    - Stopping CSRF Attacks in Your PHP Applicatio...
    - Quick and Dirty AJAX Tutorial
    - Flickr Puzzle Mashup
    - The PAVISE of Security
    - Creating a CAPTCHA with PHP
    - Sending SMS Thru HTTP
    - The Postal Fix - Part 2
    - Adding Mail with Exim
    - The Postal Fix - Part 1
    - Create Your Own Custom API
    - Adding Drop Shadows with PHP
    - Writing a Basic Authentication System in PHP
    - Overlapping Images with GD
    - Using Sockets in PHP
    - Dynamic CSS with PHP






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