Sign in to follow this  
Followers 0
langthang084

how to auto change date

7 posts in this topic

how to auto change date to 5 days agos alternately in one year (after send pause script, date will change to 5 days ago)

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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??

Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Oh yeah! Thanks U alot

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0