Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing Last Modified Date of a file to System Date

Status
Not open for further replies.

as0125

Technical User
Joined
Jun 3, 2004
Messages
70
Location
US
I'd like to get the last modified date of a file and compare it to the system date. So far, I've only been able to come up with FileDateTime and Now functions, which includes the time. But I don't want the time included. Are there any other functions that I can use or is there a way for me to trim off the time?

Dim FileDate, Today
FileDate = FileDateTime(Source)
Today = Now
 
today" may be a reserve word

try: to_day = date$
 

Thanks -- but I figured it out. This is how to format the date.

'Date formatted to m/d/yyyy
FileDate2 = Format(FileDate1, "Short Date")
Today = Format(Now, "Short Date")

By the way, "Today" is not a reserved word.
 
but,..Today is an excel function, i.e. =today()...so as a rule, I tend to stay away from integrated function names in macros, it makes things easier to trouble shoot among other things.
 

Okay -- thanks for the tip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top