+** SETTIME -- set the current time.
+**
+** Parameters:
+** none.
+**
+** Returns:
+** none.
+**
+** Side Effects:
+** Sets the various time macros -- $a, $b, $d, $t.
+*/
+
+settime()
+{
+ register char *p;
+ auto time_t now;
+ static char tbuf[20]; /* holds "current" time */
+ static char dbuf[30]; /* holds ctime(tbuf) */
+ register struct tm *tm;
+ extern char *arpadate();
+ extern struct tm *gmtime();
+ extern char *macvalue();
+
+ now = curtime();
+ tm = gmtime(&now);
+ (void) sprintf(tbuf, "%02d%02d%02d%02d%02d", tm->tm_year, tm->tm_mon+1,
+ tm->tm_mday, tm->tm_hour, tm->tm_min);
+ define('t', tbuf, CurEnv);
+ (void) strcpy(dbuf, ctime(&now));
+ *index(dbuf, '\n') = '\0';
+ if (macvalue('d', CurEnv) == NULL)
+ define('d', dbuf, CurEnv);
+ p = newstr(arpadate(dbuf));
+ if (macvalue('a', CurEnv) == NULL)
+ define('a', p, CurEnv);
+ define('b', p, CurEnv);
+}
+\f/*