Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FileDateTime help Ray Excel Programming 1 January 10th 07 03:03 AM
FileDateTime function - how to make it authomatic? bondcrash[_24_] Excel Programming 3 June 21st 06 01:57 PM
Put only date (not time too) in variable from FileDateTime function mikeburg[_64_] Excel Programming 3 January 22nd 06 06:10 AM
FileDateTime for Internet web page Mogwai Excel Programming 5 June 2nd 05 09:03 PM


All times are GMT +1. The time now is 12:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"