Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 39,743 times

Contents

Related Categories

File Time Date Stamps - Introduction

Introduction

Have you ever wanted to set a file's date and timestamp? VB allows you to look at a file's date and time with the FileDateTime function. This is fine for comparing timestamps, but sometimes you may want to artificially alter the timestamp of a file programmatically.

Here are some examples where this can be useful:

* Installation programs often will tend to overwrite older files with newer ones, but you can prevent this by assigning an artifically early date to the file so that won't happen. Alternatively, you can force an installation program to overwrite a file by assigning a very futuristic file date.
* Programs that download files via FTP or HTTP will assign a creation and last write time at the time of download. If you want to preserve the date and you are using an Internet Client ActiveX control, you can usually find out the date of the file on the server, download the file, then set the file date after it has been downloaded so that the downloaded file's date is in synch with the file on the server.

This tutorial will show you how to do all of this!

Comments

  • Re: [50] File Time Date Stamps

    Posted by OveBonde on 06 Aug 2008

    Works with VB6 provided that the file already exists.


    Won't create a new file, just a handle to an existing.


     Regards


  • Re: [50] File Time Date Stamps

    Posted by karlstamp on 10 Oct 2007

     I agree! know i probably aware with this thing. I got something new to you! And I would like to share this with you. It's nice, I guarantee www.2-clicks-stamps.com. Please check this out!
    ...

  • Re: [50] File Time Date Stamps

    Posted by b_law on 22 Mar 2007

    Hi,


         I thought this code was exactly what I wanted but it doesn't work with VB 2005. The first problem occurs in the CreateFile function with lpSecurityAttribut...

  • Re: [50] File Time Date Stamps

    Posted by BearSoft on 07 May 2006

    This seems to be a very long-winded way of doing things.


    I am looking for a simple code that will inform me of the date of any file.


    I want to populate an excel sheet with the filed...