On Thu, 7 Feb 2019, Riccardo (Jack) Lucchetti wrote:
On Sat, 2 Feb 2019, Artur T. wrote:
> Am 02.02.19 um 16:47 schrieb Sven Schreiber:
>> 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.
>
> Indeed! Thanks for this information, Allin.
>
> I've just tried on ubuntu
> <eval grab("date --date='today' +'%d/%m/%Y'")>
> which works fine!
I've just added to the git version a "$now" accessor that should simplify
things a bit; example:
<hansl>
set verbose off
x = $now
printf "%20.12f\n\n", x
yr = floor(x/10000)
x -= yr*10000
mth = floor(x/100)
x -= mth*100
day = floor(x)
x -= day
printf "Today is %d/%d/%d\n", day, mth, yr+2000
</hansl>
produces
<output>
190207.495601851871
Today is 7/2/2019
</output>
Allin, feel free to scrap it if you want!
No, I was thinking of something along those lines myself. But I wonder
if it might be more user-friendly to return a vector holding year,
month, day, hour, minute, second. I guess it would be good to know
what use people are likely to make of this facility.
Allin