Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
DraxDrax
Apprentice


Joined: 22 Mar 2009
Posts: 149

PostPosted: Sun Mar 22, 2009 11:30 pm   

Calculating the passage of days and weeks.
 
I am trying to set up a script which will keep track of when certain events occur and then let me know how much time has passed since that event. The problem is that it needs to keep track of things which happened days and weeks and even months previously.

The %time() function lets me easily record when something happens, by the time and date, then store that in a variable, but if there is a simple way to calculate the difference between two such time/dates, and output that difference in a comprehensible format, I don't know it!

I hoped one of you fine people might.

I would like to be able to see, at a glance, for example, that event x occurred 6 days, 8 hours 23 minutes and 15 seconds ago.
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Mon Mar 23, 2009 1:28 am   
 
You would need to use a database, doesn't sound simple, maybe learning sql would help
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Wed Mar 25, 2009 7:08 am   
 
There's no simple way to do it, it's just raw math. You have a couple options though.

You can use #MSS to use a JavaScript function from the web, like this one for example

Similarly you can try converting the code from this CMUD post to work in zMUD.
_________________
Asati di tempari!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
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

© 2009 Zugg Software. Hosted by Wolfpaw.net