| View previous topic :: View next topic |
| Author |
Message |
CoMMy Halfop

Joined: 24 Jul 2003 Posts: 99 Location: Cyprus
|
Posted: Mon Nov 20, 2006 6:57 pm Post subject: Calculate Date |
|
|
Hi,
I need some coding info regarding the use of date.
Basically what i need is to get some variables of a date example:
set minutes 6
set 24hour 14
set day 10
set month 12
set year 2006
And then i want the script to calculate the remaining time from today untill that date in this format:
Years,Months,Days,Hours,Minutes
a 0 should be shown only where it is not applicable. Example 2006 to 2006 is 0 years.
Any ideas how to implement this? Maybe someone has a script ready for this ? I have found a Datestill.tcl but i cant make it work like i want :S
Thanks for help:) _________________ (c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!! |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Nov 20, 2006 8:06 pm Post subject: |
|
|
| Code: | set duetime [clock scan "mm/dd/yy hh:mm:ss"]
set duration [duration [expr {$duetime - [unixtime]}]] |
Read about clock scan. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
CoMMy Halfop

Joined: 24 Jul 2003 Posts: 99 Location: Cyprus
|
Posted: Wed Nov 22, 2006 5:55 pm Post subject: |
|
|
a million thanks...
Exactly what i needed:) _________________ (c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!! |
|
| Back to top |
|
 |
|