Sign in to follow this  
Followers 0
AntiVirusGuy

Diference File Date From Current

6 posts in this topic

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

Share this post


Link to post
Share on other sites



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

if 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

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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


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

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