Jump to content
Sign in to follow this  
Tagor

Compare dates

Recommended Posts

Tagor

Is there an easy way to compare dates in an if loop? For example using the _NowDate function.

Share this post


Link to post
Share on other sites
Tagor

Yes...

<{POST_SNAPBACK}>

Can you tell me how?

Share this post


Link to post
Share on other sites
Tagor

Ofcourse, but you need to tell me first what you want to compare in your "Loop" statement ....  :)

<{POST_SNAPBACK}>

For example like this:

if 20-03-2005 < _NowDate Then

... something

(however this code doesn't work)

Share this post


Link to post
Share on other sites
Jos

For example like this:

if 20-03-2005 < _NowDate Then

... something

(however this code doesn't work)

<{POST_SNAPBACK}>

Check out _DateDiff() in the helpfile... that should enable you to compare dates.....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Tagor

Thanks that works for me. But I have one question left:

_NowDate() returns DD-MM-YYYY

But _DateDiff() works with YYYY/MM/DD

Is there an easy way to convert the _NowDate()?

Share this post


Link to post
Share on other sites
Jos

Thanks that works for me. But I have one question left:

_NowDate() returns DD-MM-YYYY

But _DateDiff() works with YYYY/MM/DD

Is there an easy way to convert the _NowDate()?

<{POST_SNAPBACK}>

Just use _NowCalc() or _NowCalcDate() in stead of _Nowdate().

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        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  

×