littledevil 0 Posted January 11, 2016 Report Share Posted January 11, 2016 i want to add the string in the variable seconds to the date and get the new date/timestamp set(#dt, $date, "Global") set(#seconds, "00:15:08", "Global") set(#diff, $add(#dt, #seconds), "Global")but its not working. it just attaches it to end of the dt e.g and gives something like #diff: 01/12/2016 00:37:1800:15:08 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 11, 2016 Report Share Posted January 11, 2016 Your best option is to use this plugin: http://ubotdev.com/free-plugin-datetime-manipualtion Then convert the time into a unix timestamp, then add only the number of seconds so if its 15 minutes 8 seconds you would add 908 to the unix timestamp.Then you can do anything with that timestamp as it represents a date and time you can read about what exactly that is here: http://www.unixtimestamp.com/ Doing this would give you a time of 15 minutes and 8 seconds into the future and solve all the little problems of factoring in minutes, hours, days of the month, year and so on that you would run into if it were say Feb 28th, 11:58 PM on a leap year or something - too many weird little things to account for without doing it this way. Here is a bit of code that shows how to do that: set(#dt,$plugin function("DateTime Manipulation.dll", "$datetime manipulation", $date, "UBOT", "UNIX", "en-US", "en-US"),"Global") set(#seconds,908,"Global") set(#diff,$add(#dt,#seconds),"Global") alert("new time: {$plugin function("DateTime Manipulation.dll", "$datetime manipulation", #diff, "UNIX", "UBOT", "en-US", "en-US")}") 1 Quote Link to post Share on other sites
littledevil 0 Posted January 11, 2016 Author Report Share Posted January 11, 2016 i subscribed but didn't get the plugin as yet in my email 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.