Jump to content
Sign in to follow this  
AntiVirusGuy

Diference File Date From Current

Recommended Posts

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

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

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  

×
×
  • Create New...