SECSDIFF() and secsdiffc()

Fortran version:

    INTEGER FUNCTION  SECSDIFF( ADATE, ATIME, ZDATE, ZTIME )
        INTEGER         ADATE, ATIME	!  starting date&time
        INTEGER         ZDATE, ZTIME	!  ending   date&time

C version:

    int secsdiffc( int  adate , int  atime ,
                   int  zdate , int  ztime )

Summary:

SECSDIFF() returns the number of seconds in the time interval starting at ADATE:ATIME and ending at ZDATE:ZTIME (which will be positive if and only if ZDATE:ZTIME is after ADATE:ATIME.

For Fortran-90 declarations and interface checking:

    USE M3UTILIO
    

See also SEC2TIME() and TIME2SEC()

Preconditions:

#include "iodecl3.h" for C.

ADATE, ATIME, ZDATE, ZTIME expressed according to Models-3 date and time conventions .

Fortran Usage:

    ...
    USE M3UTILIO
    ...
    INTEGER   SECS
    ...
    SECS = SECSDIFF( 1988001, 1, 1989365, 235959 )
C	    Now SECS is the number of seconds from one second after
C           midnight on New Year's Day, 1988 until one second before
C           midnight on New Year's EVE, 1989.  Will be 63,071,998.
    ...

C Usage:

    ...
    #include "iodecl3.h"                          
    ...
    int  secs ;
    ...
    secs = secsdiffc( 1989365, 235959, 1988001, 1 ) ;
            /*  Now secs == -63,071,998  is negative, since this 
                interval goes _backwards_ in time   */
    ...


Previous: SEC2TIME

Next: TIME2SEC

Up: Date-Time Manipulation Routines

To: Models-3/EDSS I/O API: The Help Pages