mikshaw
Group: Members
Posts: 4856
Joined: July 2004 |
|
Posted: Aug. 14 2005,13:57 |
|
Looking at the datetool I immediately noticed something that threw me off for a minute. The initial date and time displayed are constants rather than the actual current date and time.
After messing around a little i came up with a possible solution:
Code Sample | execute("date +\"tmp_date = {%Y,%m,%d,%H,%M}\" >/tmp/datetool.tmp") dofile("/tmp/datetool.tmp") remove("/tmp/datetool.tmp") | This part sets up an array according to the current date adn time.
Code Sample | year_input.value=tmp_date[1] month_input.value = format("%02u",tmp_date[2]) day_input.value = format("%02u",tmp_date[3]) hour_input.value = format("%02u",tmp_date[4]) min_input.value = format("%02u",tmp_date[5]) | This inserts the appropriate part of the array into each box.
I don't fully understand what the string "%02u" means, but it seems to do the job
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|