Jump to content
UBot Underground

Calculate Days Between Two Dates


Recommended Posts

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.

 

Link to post
Share on other sites
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.

Link to post
Share on other sites

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>
")

post-5560-0-79241100-1418816220_thumb.png

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...