diff --git a/README.md b/README.md index 666888ce..c0212da0 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,7 @@ The EXPECT command now exists to provide a means of reacting to simulator output #### Command Processing Enhancements ##### Environment variable insertion -Built In variables %DATE%, %TIME%, %DATETIME%, %LDATE%, %LTIME%, %CTIME%, %DATE_YYYY%, %DATE_YY%, %DATE_MM%, %DATE_DD%, %DATE_D%, %DATE_WYYYY%, %DATE_WW%, %TIME_HH%, %TIME_MM%, %TIME_SS%, %STATUS%, %TSTATUS%, %SIM_VERIFY%, %SIM_QUIET%, %SIM_MESSAGE% +Built In variables %DATE%, %TIME%, %DATETIME%, %LDATE%, %LTIME%, %CTIME%, %DATE_YYYY%, %DATE_YY%, %DATE_YC%, %DATE_MM%, %DATE_DD%, %DATE_D%, %DATE_WYYYY%, %DATE_WW%, %TIME_HH%, %TIME_MM%, %TIME_SS%, %STATUS%, %TSTATUS%, %SIM_VERIFY%, %SIM_QUIET%, %SIM_MESSAGE% Command Aliases Token "%0" expands to the command file name. diff --git a/scp.c b/scp.c index 87087c60..d1b53053 100644 --- a/scp.c +++ b/scp.c @@ -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;