| View previous topic :: View next topic |
| Author |
Message |
kennycheung21 Voice
Joined: 02 Mar 2011 Posts: 10
|
Posted: Fri Mar 25, 2011 12:46 pm Post subject: timestamp generation |
|
|
Hello everyone,
I'm wondering if there is any function i can use to generate a timestamp in tcl script?
And if there is any other function to generate a random number in a given range?
Please help and thank you! |
|
| Back to top |
|
 |
doggo Halfop
Joined: 05 Jan 2010 Posts: 97
|
Posted: Fri Mar 25, 2011 4:47 pm Post subject: |
|
|
| Code: | | set random [expr { int(100 * rand()) }] |
for the random number between 0-100
| Code: | | set timestamp [clock seconds] |
for the time-stamp..
you can then use the VARS $random $timestamp in yr script
hope this helps.. _________________ NON geeky!! http://gotcode4u.com/ |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Fri Mar 25, 2011 7:32 pm Post subject: Re: timestamp generation |
|
|
| kennycheung21 wrote: | Hello everyone,
I'm wondering if there is any function i can use to generate a timestamp in tcl script?
|
http://www.eggheads.org/support/egghtml/1.6.20/tcl-commands.html
and check out:
strftime
This will be handy for reference too:
http://linux.about.com/library/cmd/blcmdl3_strftime.htm
You can get the date and/or time in just about any format you want, with strftime.
| Quote: |
And if there is any other function to generate a random number in a given range?
|
Same place - tcl-commands.doc - and check out:
rand |
|
| Back to top |
|
 |
|