langthang084 Posted November 28, 2009 Share Posted November 28, 2009 how to auto change date to 5 days agos alternately in one year (after send pause script, date will change to 5 days ago) Link to comment Share on other sites More sharing options...
somdcomputerguy Posted November 28, 2009 Share Posted November 28, 2009 The _DateAdd function will change it, what you want to do with it then is another story.. a variable could just be changed, a file date/time could be changed, a system date/time could be changed.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
langthang084 Posted November 28, 2009 Author Share Posted November 28, 2009 Could U give me the code? My code : #include <Date.au3> $sNewDate = _DateAdd( 'd',-5, _NowCalcDate()) _SetDate($sNewDate) But it dont run exactly, So where's my error?? Link to comment Share on other sites More sharing options...
Developers Jos Posted November 28, 2009 Developers Share Posted November 28, 2009 Could U give me the code? My code : #include <Date.au3> $sNewDate = _DateAdd( 'd',-5, _NowCalcDate()) _SetDate($sNewDate) But it dont run exactly, So where's my error?? Have you looked at both fucntions in the Helpfile? _Setdate() needs different input than returned by _DateAdd(). 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. Link to comment Share on other sites More sharing options...
langthang084 Posted November 28, 2009 Author Share Posted November 28, 2009 I have read about _setdate but im newbie and I dont know how to use _setdate in this case. Could U help me more? Thanks! Link to comment Share on other sites More sharing options...
Developers Jos Posted November 28, 2009 Developers Share Posted November 28, 2009 Something like this should work: #include <Date.au3> $sNewDate = _DateAdd( 'd',-5, _NowCalcDate()) $aNewDate = StringSplit($sNewDate,"/") If $aNewDate[0] = 3 Then _SetDate($aNewDate[3],$aNewDate[2],$aNewDate[1]) EndIf 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. Link to comment Share on other sites More sharing options...
langthang084 Posted November 28, 2009 Author Share Posted November 28, 2009 Oh yeah! Thanks U alot Link to comment Share on other sites More sharing options...
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