Thread: file's date and time stamp

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    38

    file's date and time stamp

    How do I get a file's date and time stamp?
    I have found the FileGetDate() function but can someone show me how to use it in a program!
    Using Visual Studio 6.0.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    http://www.google.com/search?q=FileGetDate
    Bound to run across an example sooner or later...
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    I have found the FileGetDate() function
    Where?

  4. #4
    Registered User
    Join Date
    Sep 2003
    Posts
    38
    I have found it msdn but the implementation they have given is very complicated!!

  5. #5
    Registered User samGwilliam's Avatar
    Join Date
    Feb 2002
    Location
    Newport
    Posts
    382
    Quote Originally Posted by Lord CyKill
    I have found it msdn but the implementation they have given is very complicated!!
    Are you sure it wasn't a VB function (since MSDN covers that too)?
    Current Setup: Win 10 with Code::Blocks 17.12 (GNU GCC)

  6. #6
    Registered User
    Join Date
    Sep 2003
    Posts
    38
    No, I am using VC++ 6.0 and i searched in its help!

  7. #7
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483
    it also covers VB and C# and the J and all the other compilers that Visual Studio has.. Make sure its for Visual C++ not something else

  8. #8
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    It's GetFileTime(). The only issue with that function is that it uses a handle to the file rather then a name, but it is easy to get a handle using CreateFile() for example.

    Another method would be to use FindFirstFile() with the filename as the search mask. I have a 3 part tutorial starting here which shows, amongst other things, how to extract info from the file data block.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  9. #9
    Registered User
    Join Date
    Sep 2003
    Posts
    38
    Yeah, that tutorial was excellent!But here is another 1 comming.
    How can i compare the 2 dates/time strings?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  2. Date and time stamp in printing to a file
    By xIcyx in forum C Programming
    Replies: 2
    Last Post: 04-24-2007, 02:59 AM
  3. Sending an email in C program
    By Moony in forum C Programming
    Replies: 28
    Last Post: 10-19-2006, 10:42 AM
  4. Displaying time and date of files
    By wozza in forum C Programming
    Replies: 3
    Last Post: 05-25-2002, 11:53 AM