Compare dates

How do I compare (>=) 2 FolderItem by modificationdate?
I’ve tried various attributes like sqldate and totalseconds.
One file is a copy of the other and have by Mac the same time.

Have you tried SQLDATETIME (SQLDATE does not contain the time component)

I hate making posts from a mobile phone, since when I’m done keying stuff in, I’m annoyed. I didn’t mean time but date.

If fTmp <> Nil And fTmp.Exists Then If fTmp.ModificationDate.SQLDate >= fd.ModificationDate.SQLDate Then Else fdAry.Append fTmp End If End If
fdArt, fTmp, fd are all folderitem and Exist. I’ve also like I wrote tried totalseconds and direct compare of modificationdate.

What is the problem of total seconds?

If the OS put the same date/time, then they have the same date/time and there is nothing you can do about that.

So, it has to NOT be equal? The LR implies because of a greater > without >=.

Arthur… I am sorry but you are making no sense.
If the two files do in fact have DIFFERENT dates, the the SQLDATE and/or TOTALSECONDS will also be different
but if they have the same values, there is not a darn thing you can do about that

[quote=344108:@Arthur Gabhart]I hate making posts from a mobile phone, since when I’m done keying stuff in, I’m annoyed. I didn’t mean time but date.

If fTmp <> Nil And fTmp.Exists Then If fTmp.ModificationDate.SQLDate >= fd.ModificationDate.SQLDate Then Else fdAry.Append fTmp End If End If
fdArt, fTmp, fd are all folderitem and Exist. I’ve also like I wrote tried totalseconds and direct compare of modificationdate.[/quote]

Your Conditional has no Consequent after ‘Then’ before ‘Else’

Thank you Dave. It is rare that the comparison operation methods don’t include = . I can live with that. I tested it for only greater than > and it works.
Yes. Ralph. It was a first draft for a comparison I hadn’t used before.

Not rare at all.

  • =
  • =

  • <=
  • <
  • <>

those are the “basic” compare operations, and only 1/2 include the =

Just to be sure. Are you saying for Date comparison with file dates doesn’t work or does work?

Yes Date comparisons work just fine… using SQLDATE, SQLDATETIME or even TOTALSECONDS

But again… if the values ARE IN FACT EQUAL, there is NOTHING you can do to make them othewise

You say they have “the same time”, but it seems like you want them to be unequal… that makes no sense