home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Distributions / ucb / spencer_2bsd.tar.gz / 2bsd.tar / src / px / pdattim.c < prev    next >
C/C++ Source or Header  |  1980-02-17  |  380b  |  23 lines

  1. /* (c) 1979 Regents of the University of California */
  2. #include "opcode.h"
  3.  
  4. char    pd_date[] {
  5.     8, 9, 10, 4, 5, 6, 10, 22, 23, 10, 0
  6. };
  7.  
  8. pdattim(op, alfap)
  9. char *alfap;
  10. {
  11.     register char *ap, *cp, *dp;
  12.     long a;
  13.     int i;
  14.  
  15.     time(&a);
  16.     cp = ctime(&a);
  17.     ap = alfap;
  18.     if (op == O_DATE)
  19.         for (dp = pd_date; *dp; *ap++ = cp[*dp++]);
  20.     else
  21.         for (cp =+ 10, i = 10; i; *ap++ = *cp++, i--);
  22. }
  23.