ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   FileDateTime (https://www.excelbanter.com/excel-programming/436828-filedatetime.html)

Daniel Jones

FileDateTime
 
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

Per Jessen

FileDateTime
 
Hi D

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

Regards,
Per

"Daniel Jones" skrev i meddelelsen
...
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



RB Smissaert

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

RBS


"Daniel Jones" wrote in message
...
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



Chip Pearson

FileDateTime
 
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]



On Mon, 30 Nov 2009 12:08:55 -0800 (PST), Daniel Jones
wrote:

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


Rick Rothstein

FileDateTime
 
One more method...

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

--
Rick (MVP - Excel)


"Daniel Jones" wrote in message
...
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




All times are GMT +1. The time now is 06:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com