Jump to content
UBot Underground

How To Compare Two Dates


Recommended Posts

hi,

 

you can substract the 2 dates after inversed.

 

you must transform the date to that format without "/" : YYYYMMDD

Then you will get the number of days by doing

 

20191220 - 20191201

 

Good luck

 

This won't work unless the dates are in the same year and month.

 

One way is to convert the dates to a unix timestamp, subtract and then divide the result by the number of seconds in a day (86,400)

set(#startDate,$plugin function("DateTime Manipulation.dll", "$datetime manipulation", "12/01/2019", "MM/dd/yyyy", "UNIX", "en-US", "en-US"),"Global")
set(#endDate,$plugin function("DateTime Manipulation.dll", "$datetime manipulation", "12/19/2019", "MM/dd/yyyy", "UNIX", "en-US", "en-US"),"Global")
set(#difference,$divide($subtract(#endDate,#startDate),86400),"Global")
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...