Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get the time and date when the file was generated in VB

Posted on 2004-03-29
5
Medium Priority
?
290 Views
Last Modified: 2010-05-02
hi, experts, is there a way how to get the time and date of file when it was generated using VB6
0
Comment
Question by:jacristobal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 10711244
Hi,

Please replace "filename.ext" with your chosen file, and remove the removes to "datLast_Accessed" and "datLast_Modified" if you are just interested in the "datCreated"...

  Dim datCreated                              As Date
  Dim datLast_Accessed                              As Date
  Dim datLast_Modified                              As Date

  Dim objFSO                                            As Object
  Dim objFSO_GetFile                                    As Object

  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFSO_GetFile = objFSO.GetFile("filename.ext")
 
  datCreated = objFSO_GetFile.DateCreated
  datLast_Accessed = objFSO_GetFile.DateLastAccessed
  datLast_Modified = objFSO_GetFile.DateLastModified
 
  Set objFSO_GetFile = Nothing
  Set objFSO = Nothing
 
BFN,

fp.
0
 

Author Comment

by:jacristobal
ID: 10711302
tnx fp, it works
0
 
LVL 53

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 10711312
Also :

Obtaining and Changing a File's Created, Accessed and Modified Dates
http://vbnet.mvps.org/code/fileapi/filedatetime.htm

Where this using APIs and without using FSO component
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 10820665
Hello jacristobal,

Was there a specific reason why you did not wish to use my proposal even though you replied to say "it works"?
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 10820666
Hello jacristobal,

Was there a specific reason why you did not wish to use my proposal even though you replied to say "it works"?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question