file's date and time stamp

This is a discussion on file's date and time stamp within the C++ Programming forums, part of the General Programming Boards category; How do I get a file's date and time stamp? I have found the FileGetDate() function but can someone show ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,538
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    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
    Budding Synth Programmer samGwilliam's Avatar
    Join Date
    Feb 2002
    Location
    Trefforest
    Posts
    368
    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)?
    MSVC++ 6.0

  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,831
    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21