home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / flistfrontend / src / syasctim.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-21  |  1.1 KB  |  45 lines

  1. #ifndef NO_IDENT
  2. static char *Id = "$Id: syasctim.c,v 1.5 1995/10/21 18:39:50 tom Exp $";
  3. #endif
  4.  
  5. /*
  6.  * Title:    sysasctim.c
  7.  * Author:    Thomas E. Dickey
  8.  * Created:    02 Aug 1984 (broke out of 'dirent.c')
  9.  * Last update:
  10.  *        03 Jun 1995, prototypes
  11.  *        02 Aug 1984
  12.  *
  13.  * Function:    Use VMS run-time library routine to convert a 64-bit date
  14.  *        field to a printable string.  The string-length drives the
  15.  *        actual format of the conversion by selecting subsets of the
  16.  *        complete date format:
  17.  *
  18.  *            123456789.123456789.12345
  19.  *            dd-mmm-yyyy hh:mm:ss.cc
  20.  *
  21.  * Parameters:    buf[]    = output string
  22.  *        q_    => quad-word (64-bit) VMS date (origin is 17-Nov-1858,
  23.  *               to use Smithsonian time).
  24.  *        ilen    =  length to convert.
  25.  */
  26.  
  27. #include    <lib$routines.h>
  28. #include    <descrip.h>
  29.  
  30. void
  31. sysasctim (
  32.     char    *buf,            /* String to load into            */
  33.     unsigned *q_,            /* => 64-bit date structure        */
  34.     int    ilen)            /* Length of 'buf[]', counting null    */
  35. {
  36.     short    olen;
  37.     unsigned cvtflg = 0;
  38.     static    $DESCRIPTOR(date_time,"");
  39.  
  40.     date_time.dsc$a_pointer = buf;
  41.     date_time.dsc$w_length  = ilen - 1;
  42.     lib$sys_asctim (&olen, &date_time, q_, &cvtflg);
  43.     buf[olen] = '\0';
  44. }
  45.