Compare 2 dates

Hi everyone
I have 2 dates variables,

  1. is the DateTime of which a file was created
  2. is the current TimeDate
    I want to compare between the two and now if the file was created after the program started running.

thanks for the help

@dlichtenstadt Assuming both the variables are of DateTime, you should be able to compare the dates using a Simple If Condition with > or < operation

ok thanks
Because someone says to use the “DateTime.Compare” function and I only saw that it gave me 1 and -1 and I didn’t know what it meant
now I see that it’s working with what u said
so thanks

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.