decc$fix_time

Converts OpenVMS binary system times to UNIX binary times.

Format

#include  <unixlib.h>

unsigned int decc$fix_time  (void *vms_time);

Argument

vms_time
The address of a quadword containing an OpenVMS binary time:
unsigned int quadword[2];
unsigned int *vms_time = quadword;

Description

This routine converts an OpenVMS binary system time (a 64-bit quadword containing the number of 10-nanosecond ticks since 00:00 November 17, 1858) to a UNIX binary time (a longword containing the number of seconds since 00:00 January 1, 1970). This routine is useful for converting binary times returned by OpenVMS system services and RMS services to the format used by some DEC C RTL routines, such as ctime and localtime.

Return Values
A longword containing the number of seconds since 00:00 January 1, 1970. 

Example

    #include <unixlib.h>
    #include <stdio.h>
    
    main()
            {
            /* LOCALS */
            unsigned int current_vms_time[2];  */ quadword for OpenVMS time */
            unsigned int number_of_seconds;    */ number of seconds     */
    
            /* PROCEDURE */
            /* first get the current system time */
            sys$gettim( ¤t_vms_time[0] );
    
            /* fix the time */
            number_of_seconds = decc$fix_time( ¤t_vms_time[0] );
    
            printf( "Number of seconds since 00:00 January 1, 1970 = %d",
                     number_of_seconds );
            }
    

    This example shows how to use the decc$fix_time routine in DEC C. It also shows the use of the SYS$GETTIM system service.


Previous Page | Next Page | Table of Contents | Index