Results 1 to 9 of 9

Thread: Date/Time of a file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Location
    Lost
    Posts
    216

    Question Date/Time of a file

    Hi ...

    How to get the creation date and time of a certain file ???

    Thanks anyway !!!!!

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Location
    Lost
    Posts
    216
    Anyone ??????

  3. #3
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    10 minutes!! Geesh Microsoft always make undecipherable function names like FileDateTime()
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  4. #4
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    350
    Bit tetchy today Mr Laidlaw?
    .

  5. #5
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Moi? I am never tetchy (well except with those BASTARDS that try to take 10 items thru the 8 items only aisle) And in the words of one Jimbo Brown... "this thread should be in Chit Chat"
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  6. #6
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878
    Actually, the FileDateTime() function does NOT return the CREATED date of the the item.... it returns the modified date instead. If Mimo really wants the Created date, you will need to use other functions. But if all you want is the date and time that is shown in Windows Explorer, then the Modified Date is the one you want, and FileDateTime is a good one to use.

    For example:
    [Highlight=VB]
    Dim FSO, FSOf
    Set FSO = CreateObject("Scripting.FileSystemObject")
    thisFolder = "C:\Windows"
    Set FSOf = FSO.GetFolder(thisFolder)
    MsgBox FSOf.DateCreated
    MsgBox FSOf.DateLastModified
    [\vbcode]

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    VB Code:
    1. Private Sub Command1_Click()
    2. Dim MyDateTime As Variant
    3. MyDateTime = FileDateTime("c:\MyFile.Exe")
    4. MsgBox MyDateTime
    5. End Sub

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Location
    Lost
    Posts
    216
    10x beachbum, but this function returns the modification date NOT the creation date

    10x anyway !!!

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width