View Single Post
11/29/14, 01:09 AM   #3
Argusus
AddOn Author - Click to view addons
Join Date: Sep 2014
Posts: 120
Originally Posted by rkuhnjr View Post
It returns the int64 of seconds between the two dates you pass in
You would just need to check that with math to see if it is > 30 days

You will probably have a hard time figuring out the future days time stamp than anything else. It is the standard unix epoch time and there are no functions in the API that let you pass in date parameters and get back the Time stamp, at least none that I saw, Hell I couldn't even find a consistent way to get the users local time stamp, GetTimeStamp() is UTC, but the formatters all return it in the users TZ so the conversion happens in there somewhere.

Lua Code:
  1. local timeDifInSecs = GetDiffBetweenTimeStamps(futureDate, GetTimeStamp())
  2. if (timeDifInSecs > 30*86400) then
  3.   -- Its longer than 30 days
  4. else
  5.  -- its not longer
  6. end
great, thanks.
  Reply With Quote