The450Man 0 Posted December 15, 2014 Report Share Posted December 15, 2014 How can this be done? Here is a web example of what I want to do within ubot. http://www.timeanddate.com/date/duration.html I know how to calculate the current daynumber of the year with javascript but cant calculate the daynumber of a specific date. Quote Link to post Share on other sites
UBotDev 276 Posted December 15, 2014 Report Share Posted December 15, 2014 I think the easiest way is to use my FREE plugin. Here is an example: Compare two UNIX timestamps to get time difference So you would get number of seconds between 2 dates...to get days you would simply divide that number with 86400. 1 Quote Link to post Share on other sites
jomark3 25 Posted December 17, 2014 Report Share Posted December 17, 2014 For today: Dec 17, 2014: multiply (4 digit year - 2014) by 10,000 multiply(2 digit month - 12) by 100 set (2 digit day - 17) Add these 3 numbers together and get a total like 20141217 Do the same for your second date and subtract the totals. Quote Link to post Share on other sites
pash 504 Posted December 17, 2014 Report Share Posted December 17, 2014 is easy on my plugin load html("Days: {$plugin function("Advanced DateTime.dll", "$date time difference", "12/17/2014 18:29:05", "02/17/2014 18:29:05", "UBOT (MM/dd/yyyy HH:mm:ss)", "Total Days")}<br> Hours: {$plugin function("Advanced DateTime.dll", "$date time difference", "12/17/2014 18:29:05", "02/17/2014 18:29:05", "UBOT (MM/dd/yyyy HH:mm:ss)", "Total Hours")}<br> Minutes: {$plugin function("Advanced DateTime.dll", "$date time difference", "12/17/2014 18:29:05", "02/17/2014 18:29:05", "UBOT (MM/dd/yyyy HH:mm:ss)", "Total Minutes")}<br> Seconds: {$plugin function("Advanced DateTime.dll", "$date time difference", "12/17/2014 18:29:05", "02/17/2014 18:29:05", "UBOT (MM/dd/yyyy HH:mm:ss)", "Total Seconds")}<br> ") Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.