[GRASSLIST:5843] scripting: time with awk/python/perl???

Cannata, Massimiliano massimiliano.cannata at supsi.ch
Fri Feb 18 08:08:23 EST 2005


Hello, I'm writing a shall script calling different grass 
command, but i need to handle datetime variables: how can 
it be done?
In particular I need to loop between FROMdate/TOdate by 
Timestep; I see it is possible use strftime() to 
formatting time variable and systime() to get current 
time, but how can be a string parsed and converted in 
datetime variable?
I try mktime() but i cannot get the correct use, the line

gawk "BEGIN{print strftime(\"%d %b %Y\",mktime(\"2005 12 
09 12 00\")) javascript:doImageSubmit('Send')}"

return me always: 01 Jan 1970

I suppose it is a problem of formatting input, but how do 
i have to do?
Is maybe the case to use python or perl for scripting? but 
how to handle with g.parser? Is there any example of 
python scripting with GRASS available?

Thanks a lot.
Maxi



_
--------------------------------------
Eng. Massimiliano Cannata
Phd student
www.supsi.ch




More information about the grass-user mailing list