bjwade62 Posted October 4, 2006 Posted October 4, 2006 I can use FileDateTime("c:\temp\document.log") to retreive the date and time down to the seconds. That's the problem, I don't want it down to the second. Is there some sort of a trim method or function I can use to cut the seconds out? Thanks, Bernie Quote
Gill Bates Posted October 4, 2006 Posted October 4, 2006 It returns a date, so you can format it however you want. Here's some format codes: http://msdn2.microsoft.com/en-us/library/8kb3ddd4.aspx Quote
bjwade62 Posted October 4, 2006 Author Posted October 4, 2006 Thanks. Unless I'm missing something, I can't see how to get the time without the seconds but with am/pm. Trying to get - 12:31 AM Don't want - 12:31:21 AM Thanks for the help! It returns a date, so you can format it however you want. Here's some format codes: http://msdn2.microsoft.com/en-us/library/8kb3ddd4.aspx Quote
Administrators PlausiblyDamp Posted October 4, 2006 Administrators Posted October 4, 2006 What code are you using to format the string? If none of the built in formats are suitable use the information on the page linked by Gill to build your own custom format. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
bjwade62 Posted October 4, 2006 Author Posted October 4, 2006 Here's what I'm using. Dim dDate As String = Format(FileDateTime(SelFileName), "MM/dd/yyyy hh:mm") What code are you using to format the string? If none of the built in formats are suitable use the information on the page linked by Gill to build your own custom format. Quote
Administrators PlausiblyDamp Posted October 5, 2006 Administrators Posted October 5, 2006 MessageBox.Show(System.IO.File.GetCreationTime("c:\boot.ini").ToString("MM/dd/yyyy hh:mm tt")) works fine on my system. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.