[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::vaxc

Title:VAX C Notes
Notice:READ 1.* BEFORE WRITING; USE KEYWORDS TO FIND EXISTING NOTES
Moderator:DECC::VMCCUTCHEON
Created:Sat Jan 25 1986
Last Modified:Mon Jun 02 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:5611
Total number of notes:27963

5603.0. "localtime function" by DPPSYS::BOLLAND () Mon Feb 10 1997 12:08

    
    The localtime function (converting a time expressed as the number of
    seconds since 01 January 1970 into hrs,mins,secs etc) produces different 
    results when compiled/linked/run on OpenVMS VAX and Digital UNIX.
    
    OpenVMS VAX gives the following results :
    
    Winter time in seconds is 856991741
    Summer time in seconds is 867705341
    Current time in seconds is 855591214
    Winter time (locally) is 26-01-97 21:15:41
**  Summer time (locally) is 30-05-97 21:15:41 **
    Current time (locally) is 10-01-97 16:13:34
    
    Digital UNIX gives the following results :
    
    Winter time in seconds is 856991741
    Summer time in seconds is 867705341
    Current time in seconds is 855591214
    Winter time (locally) is 26-01-97 21:15:41
**  Summer time (locally) is 30-05-97 22:15:41  **
    Current time (locally) is 10-01-97 16:13:34
    
    The DU results were from a system whose timezone was set to GMT.  
    
    Will I get different results on different DU systems depending on the
    timezone setting ?
    
    Will all OVMS systems give the same results or is there also a timezone
    factor ?
    
    
T.RTitleUserPersonal
Name
DateLines
5603.1If DEC C, Use V7.0 or later...XDELTA::HOFFMANSteve, OpenVMS EngineeringMon Feb 10 1997 14:0932
   I'd tend to avoid localtime and the traditional UNIX time values when
   feasible -- the seconds since 1-Jan-1970 format -- in favor of using
   UTC and similar calls, and calls to the native OpenVMS time routines.
   The UNIX epoch fails in 2038, and folks are busy chopping out all the
   Year-2000 failures already...  (Retire?  Who, me?  :-)
    
:    Will all OVMS systems give the same results or is there also a timezone
:    factor ?

   VAX C -- the compiler and RTL covered by this conference -- is very
   old.  DEC C -- the current-generation C compiler, and compatible with
   the UNIX DEC C compiler, is covered in TURRIS::DECC.

   If you are using VAX C, I doubt this will be fixed/enhanced...  VAX C
   and the VAX C RTL was replaced with DEC C five+ years ago, and only
   critical RTL bugfixes are likely to be implemented...
    
   You will want to mention the OpenVMS VAX version, and (if using it) the
   DEC C version.

   UTC support was added in V6.0 and later OpenVMS, and the DEC C RTL
   started taking advantage of this support in rather more recent OpenVMS
   releases.  (Prior to this, the time calls all returned local time...) 
   There is a list of RTL functions and release dates available at URL
   http://hndymn.zko.dec.com/~crtl/when_functions_were_released.html.
   Much (all?) of the DEC C UTC support was added in the DECC$SHR first
   shipping in V7.0.

   The time and timezone is set via procedures in SYS$MANAGER:.  See the
   more recent OpenVMS new features documentation for information.