ikebukuro 1 Posted September 10, 2013 Report Share Posted September 10, 2013 Didn't find anything on the forum about this yet, so hopefully this will be useful to anyone searching how to do it in the future. Was using javascript to generate random dates before, but like this way better as it doesn't need a webpage. You will need the free datetime manipulation plugin created by UBotDev.com: http://www.ubotstudio.com/forum/index.php?/topic/13665-free-plugin-datetime-manipulation/ Thanks should go to UBotDev.com for creating and giving out this very handy plugin for free. Example code below: define $Random DateTime(#date start, #date end) { set(#date start unix, $plugin function("DateTime Manipulation.dll", "$datetime manipulation", #date start, "M/d/yyyy", "UNIX", "en-US", "en-US"), "Local") set(#date end unix, $plugin function("DateTime Manipulation.dll", "$datetime manipulation", #date end, "M/d/yyyy", "UNIX", "en-US", "en-US"), "Local") return($plugin function("DateTime Manipulation.dll", "$datetime manipulation", $rand(#date start unix, #date end unix), "UNIX", "yyyy-MM-dd HH:mm:ss", "en-US", "en-US")) } ui text box("Start Date (M/d/yyyy)", #date start) ui text box("End Date (M/d/yyyy)", #date end) loop(3) { alert($Random DateTime(#date start, #date end)) } Input format set to: M/d/yyyyOutput format set to: yyyy-MM-dd HH:mm:ssChange it up to your preferred formats of course. Useful for scheduling a batch of blog posts to random dates, or other purposes. 1 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted September 10, 2013 Report Share Posted September 10, 2013 Very cool! Quote Link to post Share on other sites
UBotDev 276 Posted September 10, 2013 Report Share Posted September 10, 2013 Great example of usage, thanks for sharing the code. I've just added a link to this topic from the original plugin page here on forum, I hope you don't mind. Quote Link to post Share on other sites
ikebukuro 1 Posted September 12, 2013 Author Report Share Posted September 12, 2013 I'm happy to hear that! Thanks again for the great plugin. 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.