Am 02.02.2019 um 15:31 schrieb Allin Cottrell:
and this should work on OS X too. On Windows I think that
string s = grab("date /t")
ought to work but I haven't tested it. I see that grab() never got
documented, but it retrieves the output from a shell command.
Interesting.
I just tried the following on Windows 10:
? eval grab("echo %date%")
02.02.2019
So the format is locale-dependent, which could be a problem (same for
"date /t" or %time%).
Another solution on Windows might be this:
? eval grab("powershell get-date -format T")
16:41:36
? eval grab("powershell get-date -format t")
16:42
? eval grab("powershell get-date -format s")
2019-02-02T16:43:03
? eval grab("powershell get-date -format u")
2019-02-02 16:44:26Z
The last two are oriented at ISO 8601.
Powershell should be available on up-to-date patched Windows systems I
think.
cheers,
sven