FileDateTime

D

Daniel Jones

Is there a way to return just the time from the FileDateTime method?

i.e. id like strA to return "5:00PM" instead of "11/30/09 5:00PM"

strA = FileDateTime("C:\Temp\Book1.xls")

Thanks!

D
 
P

Per Jessen

Hi D

strA = Format((FileDateTime("C:\Temp\Book1.xls")), "h:mmAM/PM")

Regards,
Per
 
C

Chip Pearson

Try something like

Dim FName As String
Dim D As Double
Dim TimeOnly As Double
FName = "C:\Book1.xls"
D = FileDateTime(FName)
TimeOnly = D - Int(D)
Debug.Print Format(TimeOnly, "hh:mm:ss")

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]
 
Top