Administration
  Home arrow Administration arrow UNIX Time Format Demystified
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
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? 
Google.com  
ADMINISTRATION

UNIX Time Format Demystified
By: Barzan "Tony" Antal
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 3
    2008-04-29


    Table of Contents:
  • UNIX Time Format Demystified
  • The Theory
  • Conversion Examples
  • Final Thoughts

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    UNIX Time Format Demystified
    ( Page 1 of 4 )

    UNIX format timestamps have an extensive range of use. You will find out the main reasons that back up this claim, but for now, let’s say that it is because working with dates and times in the UNIX time format is easier and more resource efficient. In this article, our goal is to demystify the concept, learn the theory that lies behind it, and ultimately write algorithms and implementations that convert dates back and forth from the traditional ISO standard to UNIX format.UNIX time, which is sometimes referred to as POSIX time, is a relatively “simple” format that represents time using its very own system. I’ve opted for the quotations around simple because, despite how it’s going to look at first glance, by the time you finish reading this article, I am sure that you’re going to find them quite simple and effective.

    (Image Courtesy of Cubus)

    Let me give you some examples of dates in UNIX time if for whatever reason you haven’t been able to come across any until now. Check out the example below:

    962452800 -> 2000-07-01T12:00:00+00:00 -> Sat, 01 Jul 2000 12:00:00 +0000

    1215129600 -> 2008-07-04T00:00:00+00:00 -> Fri, 04 Jul 2008 00:00:00 +0000

    1577909730 -> 2020-01-01T20:15:30+00:00 -> Wed, 01 Jan 2020 20:15:30 +0000

    In the above example, the first column is the time specified in UNIX time format, the second is in the widely popular ISO 8601 standard, and the latter is in RFC 2822 format, which is also called Internet Message Format. For a detailed guide and information regarding the RFC 2822, I’d suggest checking out this document. It is the official abstract related to the standard and its outlines.

    Now that you’ve seen some examples of UNIX time, those strings of digits must seem a bit odd, right? It’s weird when somebody suggests that they represent valid dates and times. On the next page, we’re going to explain the theory and the mathematics behind it.



     
     
    >>> More Administration Articles          >>> More By Barzan "Tony" Antal
     

       

    ADMINISTRATION ARTICLES

    - Network Booting via PXE: the Basics
    - Scalix: Linux Administrator`s Guide
    - Network Administration with FreeBSD 7
    - Components of an Information Architecture
    - The Anatomy of an Information Architecture
    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek