egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Calculate Date

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
CoMMy
Halfop


Joined: 24 Jul 2003
Posts: 99
Location: Cyprus

PostPosted: Mon Nov 20, 2006 6:57 pm    Post subject: Calculate Date Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Nov 20, 2006 8:06 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
CoMMy
Halfop


Joined: 24 Jul 2003
Posts: 99
Location: Cyprus

PostPosted: Wed Nov 22, 2006 5:55 pm    Post subject: Reply with quote

a million thanks...

Exactly what i needed:)
_________________
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber