SCP: Add insertion symbol UTIME for Unix time (seconds since 1/1/1970)
This commit is contained in:
parent
c8ab527f4c
commit
9c930092a4
2 changed files with 9 additions and 1 deletions
|
@ -332,6 +332,7 @@ Built In variables %DATE%, %TIME%, %DATETIME%, %LDATE%, %LTIME%, %CTIME%, %DATE_
|
||||||
%LDATE% mm/dd/yy (Locale Formatted)
|
%LDATE% mm/dd/yy (Locale Formatted)
|
||||||
%LTIME% hh:mm:ss am/pm (Locale Formatted)
|
%LTIME% hh:mm:ss am/pm (Locale Formatted)
|
||||||
%CTIME% Www Mmm dd hh:mm:ss yyyy (Locale Formatted)
|
%CTIME% Www Mmm dd hh:mm:ss yyyy (Locale Formatted)
|
||||||
|
%UTIME% nnnn (Unix time - seconds since 1/1/1970)
|
||||||
%DATE_YYYY% yyyy (0000-9999)
|
%DATE_YYYY% yyyy (0000-9999)
|
||||||
%DATE_YY% yy (00-99)
|
%DATE_YY% yy (00-99)
|
||||||
%DATE_MM% mm (01-12)
|
%DATE_MM% mm (01-12)
|
||||||
|
|
9
scp.c
9
scp.c
|
@ -1373,6 +1373,7 @@ static const char simh_help[] =
|
||||||
"++%%LDATE%% mm/dd/yy (Locale Formatted)\n"
|
"++%%LDATE%% mm/dd/yy (Locale Formatted)\n"
|
||||||
"++%%LTIME%% hh:mm:ss am/pm (Locale Formatted)\n"
|
"++%%LTIME%% hh:mm:ss am/pm (Locale Formatted)\n"
|
||||||
"++%%CTIME%% Www Mmm dd hh:mm:ss yyyy (Locale Formatted)\n"
|
"++%%CTIME%% Www Mmm dd hh:mm:ss yyyy (Locale Formatted)\n"
|
||||||
|
"++%%UTIME%% nnnn (Unix time - seconds since 1/1/1970)\n"
|
||||||
"++%%DATE_YYYY%% yyyy (0000-9999)\n"
|
"++%%DATE_YYYY%% yyyy (0000-9999)\n"
|
||||||
"++%%DATE_YY%% yy (00-99)\n"
|
"++%%DATE_YY%% yy (00-99)\n"
|
||||||
"++%%DATE_MM%% mm (01-12)\n"
|
"++%%DATE_MM%% mm (01-12)\n"
|
||||||
|
@ -3191,8 +3192,10 @@ return stat | SCPE_NOMESSAGE; /* suppress message sinc
|
||||||
variables:
|
variables:
|
||||||
%DATE% yyyy-mm-dd
|
%DATE% yyyy-mm-dd
|
||||||
%TIME% hh:mm:ss
|
%TIME% hh:mm:ss
|
||||||
|
%DATETIME% yyyy-mm-ddThh:mm:ss
|
||||||
%STIME% hh_mm_ss
|
%STIME% hh_mm_ss
|
||||||
%CTIME% Www Mmm dd hh:mm:ss yyyy
|
%CTIME% Www Mmm dd hh:mm:ss yyyy
|
||||||
|
%UTIME% nnn (Unix time - seconds since 1/1/1970)
|
||||||
%STATUS% Status value from the last command executed
|
%STATUS% Status value from the last command executed
|
||||||
%TSTATUS% The text form of the last status value
|
%TSTATUS% The text form of the last status value
|
||||||
%SIM_VERIFY% The Verify/Verbose mode of the current Do command file
|
%SIM_VERIFY% The Verify/Verbose mode of the current Do command file
|
||||||
|
@ -3292,7 +3295,7 @@ for (; *ip && (op < oend); ) {
|
||||||
ap = rbuf;
|
ap = rbuf;
|
||||||
}
|
}
|
||||||
/* Locale oriented formatted date/time info */
|
/* Locale oriented formatted date/time info */
|
||||||
if (!strcmp ("LDATE", gbuf)) {
|
else if (!strcmp ("LDATE", gbuf)) {
|
||||||
strftime (rbuf, sizeof(rbuf), "%x", tmnow);
|
strftime (rbuf, sizeof(rbuf), "%x", tmnow);
|
||||||
ap = rbuf;
|
ap = rbuf;
|
||||||
}
|
}
|
||||||
|
@ -3317,6 +3320,10 @@ for (; *ip && (op < oend); ) {
|
||||||
#endif
|
#endif
|
||||||
ap = rbuf;
|
ap = rbuf;
|
||||||
}
|
}
|
||||||
|
else if (!strcmp ("UTIME", gbuf)) {
|
||||||
|
sprintf (rbuf, "%" LL_FMT "d", (LL_TYPE)now);
|
||||||
|
ap = rbuf;
|
||||||
|
}
|
||||||
/* Separate Date/Time info */
|
/* Separate Date/Time info */
|
||||||
else if (!strcmp ("DATE_YYYY", gbuf)) {/* Year (0000-9999) */
|
else if (!strcmp ("DATE_YYYY", gbuf)) {/* Year (0000-9999) */
|
||||||
strftime (rbuf, sizeof(rbuf), "%Y", tmnow);
|
strftime (rbuf, sizeof(rbuf), "%Y", tmnow);
|
||||||
|
|
Loading…
Add table
Reference in a new issue