AntiVirusGuy Posted May 20, 2006 Share Posted May 20, 2006 Can some one tell me why this does not work, how to fix it and how to dissregard the hours minutes and seconds #include<date.au3> $n_tFile = "D:\zlsSetup_61_744_001_en.exe"; the date is 4/20/2006 $n_Fdate = FileGetTime($n_tFile,1) $sdate=_Now() $edate=_NowCalc() $diff= 30 If _DateDiff ('d',$sdate,$eDate) < $diff then msgbox(64,"Less than",$diff) Else msgbox(64,"more than",$diff) ; EndIf Link to comment Share on other sites More sharing options...
rbhkamal Posted May 20, 2006 Share Posted May 20, 2006 Can some one tell me why this does not work, how to fix it and how to dissregard the hours minutes and seconds #include<date.au3> $n_tFile = "D:\zlsSetup_61_744_001_en.exe"; the date is 4/20/2006 $n_Fdate = FileGetTime($n_tFile,1) $sdate=_Now() $edate=_NowCalc() $diff= 30 If _DateDiff ('d',$sdate,$eDate) < $diff then msgbox(64,"Less than",$diff) Else msgbox(64,"more than",$diff) ; EndIfif you read the helpyou will see that: _Now() returns the date in the format mm/dd/yyyy _DateDiff() Input date in the format "YYYY/MM/DD[ HH:MM:SS]" you will have to do this(or some thing similar: #include<date.au3> $n_tFile = "D:\zlsSetup_61_744_001_en.exe"; the date is 4/20/2006 $n_Fdate = FileGetTime($n_tFile,1) $sdate=_Now() $sdate = StringSplit( $sdate , " " ) $sdate = $sdate[1] $edate=_NowCalc() $edate = StringSplit( $edate , " " ) $edate = $edate[1] ;Disregarding the mins and hours $edate = StringSplit( $edate , "/" ) $edate = $edate[3]&"/"&$edate[2]&"/"&$edate[1];Reordering to match the format "YYYY/MM/DD $diff= 30 If _DateDiff ('d',$sdate,$eDate) < $diff then msgbox(64,"Less than",$diff) Else msgbox(64,"more than",$diff) ; EndIf I didn't test anything ...good night "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix Link to comment Share on other sites More sharing options...
AntiVirusGuy Posted May 20, 2006 Author Share Posted May 20, 2006 I did read it I just figured it out. Thanks for the help but please hold the sarcasm. For someone with out any programming experience there is a lot to digest #include<date.au3> $n_tFile = "D:\zlsSetup_61_744_001_en.exe"; the date is 4/20/2006 $n_Fdate = FileGetTime($n_tFile,1) $edate=_NowCalc() $diff= 31 $n_Fdate[5] $t=$n_Fdate[0] & "/" & $n_Fdate[1] & "/" & $n_Fdate[2] If _DateDiff ('d',$t,$eDate) < $diff then msgbox(64,"Less than",$diff) Else msgbox(64,"more than",$diff) Link to comment Share on other sites More sharing options...
Valuater Posted May 20, 2006 Share Posted May 20, 2006 a really, really nice date/file check/copy/update is herehttp://www.autoitscript.com/forum/index.ph...st=0&p=1856518) Link to comment Share on other sites More sharing options...
rbhkamal Posted May 20, 2006 Share Posted May 20, 2006 Please hold the sarcasm.That wasn't my intention, I love to help people in this form just like the way they helped me. "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix Link to comment Share on other sites More sharing options...
Developers Jos Posted May 20, 2006 Developers Share Posted May 20, 2006 if you read the helpyou will see that: #include<date.au3> $edate=_NowCalc() $edate = StringSplit( $edate , " " ) $edate = $edate[1] ;Disregarding the mins and hours $edate = StringSplit( $edate , "/" ) $edate = $edate[3]&"/"&$edate[2]&"/"&$edate[1];Reordering to match the format "YYYY/MM/DD I didn't test anything ...good night If you read the helpfile than ...... _NowCalcDate -------------------------------------------------------------------------------- Returns the current Date in format YYYY/MM/DD. #Include <Date.au3> _NowCalcDate() Return Value Returns the current Date in format YYYY/MM/DD 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...
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