jamesnewbie Posted July 2, 2008 Posted July 2, 2008 I've spent ages trying to figure out who to add 7 days to the current date and put it into DDMMYY format.I can do both indivdually MsgBox ( 0, "DDMMYY", @MDAY & @MON & StringRight (@Year, 2 ) ) and $sNewDate = _DateAdd( 'd',5, _NowCalcDate()) but can't do both.Any help would be appreciate - oh I also need to SEND it so please advise how I send the variable once it's calculated and formatted.Send("090708") Thanks
Developers Jos Posted July 2, 2008 Developers Posted July 2, 2008 Something like this: #include<date.au3> $sNewDate = _DateAdd('d', 5, _NowCalcDate()) $aNewDate = StringSplit($sNewDate,"/") $Date = $aNewDate[3] & $aNewDate[2] & $aNewDate[1] Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
weaponx Posted July 2, 2008 Posted July 2, 2008 (edited) #include <Date.au3> Dim $MyDate Dim $MyTime $sNewDate = _DateAdd( 'd',7, _NowCalcDate()) _DateTimeSplit($sNewDate,$MyDate,$MyTime) $NewDate = StringFormat("%02i%02i%s",$MyDate[3],$MyDate[2],StringRight($MyDate[1],2)) MsgBox(0,"",$NewDate) Edited July 3, 2008 by weaponx
weaponx Posted July 2, 2008 Posted July 2, 2008 (edited) #include <Date.au3> $sNewDate = _DateAdd( 'd',7, _NowCalcDate()) ;Convert YYYY/MM/DD to DDMMYYYY $new = StringRegExpReplace($sNewDate, "\A(\d{4})/(\d{2})/(\d{2})","$3$2$1") MsgBox(0,"",$new)oÝ÷ Ù«¢+Ø¥¹±Õ±ÐíѹÔÌÐì(ÀÌØíÍ9ÝÑô}Ñ ÌäíÌäì°Ü°}9½Ý ±Ñ ¤¤(í ½¹ÙÉÐeeed½54½Ñ¼55ed(ÀÌØí¹ÜôMÑÉ¥¹IáÁIÁ± ÀÌØíÍ9ÝѰÅÕ½ÐìÀäÈí¸¸ ÀäÈíìÉô¤¼ ÀäÈíìÉô¤¼ ÀäÈíìÉô¤ÅÕ½Ðì°ÅÕ½ÐìÀÌØìÌÀÌØìÈÀÌØìÄÅÕ½Ðì¤)5Í ½à À°ÅÕ½ÐìÅÕ½Ðì°ÀÌØí¹Ü¤ Edited July 3, 2008 by weaponx
jamesnewbie Posted July 13, 2008 Author Posted July 13, 2008 Excellent - thank you very much for your help - really appreciate it muttley
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now