Jump to content

Compare dates


 Share

Recommended Posts

  • Developers

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

<{POST_SNAPBACK}>

Yes...

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

  • Developers

Can you tell me how?

<{POST_SNAPBACK}>

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

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

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)

Link to comment
Share on other sites

  • Developers

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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...