1
0
mirror of https://github.com/simh/simh.git synced 2026-01-26 04:01:38 +00:00

SCP: Added expansion of special built-in environment variable DATE_YC which is the century of the current date.

This commit is contained in:
Mark Pizzolato
2014-12-03 10:39:19 -08:00
parent cd9a499c94
commit 1f20041b58
2 changed files with 5 additions and 1 deletions

4
scp.c
View File

@@ -2933,6 +2933,10 @@ for (; *ip && (op < oend); ) {
strftime (rbuf, sizeof(rbuf), "%y", tmnow);
ap = rbuf;
}
else if (!strcmp ("DATE_YC", gbuf)) {/* Century (year/100) */
sprintf (rbuf, "%d", (tmnow->tm_year + 1900)/100);
ap = rbuf;
}
else if (!strcmp ("DATE_MM", gbuf)) {/* Month number (01-12) */
strftime (rbuf, sizeof(rbuf), "%m", tmnow);
ap = rbuf;