File Time Date Stamps

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!

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“C++ : Where friends have access to your private members.” - Gavin Russell Baker