Hello,

 

Apologies if this question is too rudimentary, but I need to get the current data from the os. I cannot find a hansl comand or function to do this (maybe I am just being thick). The following works in Windows 7, but I do not have a linux or mac box to develop something other platforms. Would this be a handy thing to add? Maybe to the system bundle?

 

<hansl>

function string today()

    string cdate = $(Echo %date%)

            cdate = strstrip(strsub(cdate,"/"," "))

            cdate = strsplit(cdate,4)~"-"~strsplit(cdate,2)~"-"~strsplit(cdate,3)

    return cdate

end function

</hansl>

 

Output on Win 7 64 bit:

 

gretl version 1.9.90

Current session: 2014-07-17 12:03

 

? function string today()

> string cdate = $(Echo %date%)

> cdate = strstrip(strsub(cdate,"/"," "))

> cdate = strsplit(cdate,4)~"-"~strsplit(cdate,2)~"-"~strsplit(cdate,3)

> return cdate

> end function

? current_date = today()

Replaced string current_date

? print current_date

2014-07-17