asdofasdas 0 Posted May 23, 2011 (edited) So let's say I have a time string like '23.05.2011 11:39' (or what's the best format they come in). How can I add 33 hours and 33 minutes to this string? And then how do I compare these strings, which is bigger/larger/later? Just looking for some direction to know which functions to work with. Thank you! Edited May 23, 2011 by asdofasdas Share this post Link to post Share on other sites
hannes08 39 Posted May 23, 2011 (edited) So let's say I have a time string like '23.05.2011 11:39' (or what's the best format they come in). How can I add 33 hours and 33 minutes to this string? And then how do I compare these strings, which is bigger/larger/later? Just looking for some direction to know which functions to work with. Thank you! Hi, take a look at _DateAdd and _DateDiff in the helpfile. Example: #include <date.au3> $olddate = '2011/05/23 11:39' ; As it has to have the format YYYY/MM/DD HH:MM:SS $newdate = _DateAdd("n", 33 * 60 + 33, $olddate) $difdate = _DateDiff($newdate, $olddate) Edit: added forgotten include. Edited May 23, 2011 by Hannes123 Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Share this post Link to post Share on other sites
jchd 1,514 Posted May 23, 2011 MM/DD/YYYY is a terrible format for date strings as they don't sort correctly and most library calls you find around (AutoIt or not) will require ISO 8601 or a compatible subset of (like YYYY-MM-DD) for dates/times in string format. Changing the separator slash from/to hyphen is straightforward. Formats significantly departing from ISO8601 should be only used for user display but never for storage or computation. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Share this post Link to post Share on other sites