Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3167

Show
Ignore:
Timestamp:
02/11/08 01:22:29 (10 months ago)
Author:
schveiguy
Message:

Added more documentation to help explain how Tango time relates to Unix time (references #763)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/time/Time.d

    r3166 r3167  
    468468        in the Gregorian calendar is Time.epoch - TimeSpan.days(1). 
    469469 
     470        Note: common system epochs are provided to allow calculation of time 
     471        in other time systems.  For example, to convert a Time myTime to Unix 
     472        time (number of seconds elapsed since 1/1/1970), you can write: 
     473 
     474        -------- 
     475        auto unixTime = (myTime - Time.epoch1970).seconds; 
     476        -------- 
     477 
    470478******************************************************************************/ 
    471479 
     
    482490        /// Represents the smallest and largest Time value. 
    483491        static const Time min       = {minimum}, 
    484                           max       = {maximum}, 
    485                           epoch     = {0}, 
    486                           epoch1601 = {TimeSpan.Epoch1601}, 
    487                           epoch1970 = {TimeSpan.Epoch1970}; 
     492                          max       = {maximum}; 
     493 
     494        /// Represents the epoch (1/1/0001) 
     495        static const Time epoch     = {0}; 
     496 
     497        /// Represents the epoch of 1/1/1601 (Commonly used in Windows systems) 
     498        static const Time epoch1601 = {TimeSpan.Epoch1601}; 
     499 
     500        /// Represents the epoch of 1/1/1970 (Commonly used in Unix systems) 
     501        static const Time epoch1970 = {TimeSpan.Epoch1970}; 
    488502 
    489503        /**********************************************************************