Need to set file date/time 
Author Message
 Need to set file date/time

        I need to alter a file's date/time.  Am I missing something
*VERY* basic (hmmm...) or is VB not capable of this minor feat??  I've
looked in the docs, hlps, faqs, MSDevNet CD, and my dirty laundry hamper.  
No dice.  I see there's a "utime" function in the windows (W32 only?)
API, but I would hate to have to write a DLL to use it ...

--
+--------------------------------+---------------------------+

|      "your storage answer"     |     "WTB : clever sig"    |
+--------------------------------+---------------------------+



Sat, 14 Feb 1998 03:00:00 GMT  
 Need to set file date/time

Quote:

> I need to alter a file's date/time.  Am I missing something
> *VERY* basic (hmmm...) or is VB not capable of this minor feat??  I've
> looked in the docs, hlps, faqs, MSDevNet CD, and my dirty laundry hamper.  
> No dice.  I see there's a "utime" function in the windows (W32 only?)
> API, but I would hate to have to write a DLL to use it ...

You're missing something *VERY* basic (hmmm...). Use Date$ = "xx.xx.xx" and
Time$ = "xx:xx:xx".

Jens
--
* Everything I said are the opinions of someone else.*
* I just cut-and-pasted.*

Jens Balchen jr.



Mon, 16 Feb 1998 03:00:00 GMT  
 Need to set file date/time

Quote:

>> I need to alter a file's date/time.  Am I missing something
>> *VERY* basic (hmmm...) or is VB not capable of this minor feat??  I've
>> looked in the docs, hlps, faqs, MSDevNet CD, and my dirty laundry hamper.  
>> No dice.  I see there's a "utime" function in the windows (W32 only?)
>> API, but I would hate to have to write a DLL to use it ...

>You're missing something *VERY* basic (hmmm...). Use Date$ = "xx.xx.xx" and
>Time$ = "xx:xx:xx".

        OK, so Date$="xx.xx.xx" and Time$="xx.xx.xx". Now how do I set the
file's date-time stamp?

--
David Ullrich
Don't you guys find it tedious typing the same thing
after your signature each time you post something?
I know I do, but when in Rome...



Tue, 17 Feb 1998 03:00:00 GMT  
 Need to set file date/time

Quote:

> > I need to alter a file's date/time.  Am I missing something
> > *VERY* basic (hmmm...) or is VB not capable of this minor feat??  I've
> > looked in the docs, hlps, faqs, MSDevNet CD, and my dirty laundry hamper.  
> > No dice.  I see there's a "utime" function in the windows (W32 only?)
> > API, but I would hate to have to write a DLL to use it ...

> You're missing something *VERY* basic (hmmm...). Use Date$ = "xx.xx.xx" and
> Time$ = "xx:xx:xx".

These will change the entire system's notion of the date and
time! Isn't that a bit drastic, not to mention unfriendly to any
other applications that might be running?

It's better to go the DLL route. You want int 0x21 function 0x57.
Example code is in the DevNet CD under _dos_setftime.

[chomp]

--

WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Tue, 17 Feb 1998 03:00:00 GMT  
 Need to set file date/time

Quote:

> OK, so Date$="xx.xx.xx" and Time$="xx.xx.xx". Now how do I set the
> file's date-time stamp?

Open, Close.

Jens
--
* Everything I said are the opinions of someone else.   *
* I just cut-and-pasted.                                *

Jens Balchen jr.

P.O.Box 6052
N-4602 Kristiansand



Thu, 19 Feb 1998 03:00:00 GMT  
 Need to set file date/time

Quote:

>Subject: Re: Need to set file date/time
>Date: 3 Sep 1995 01:10:34 +0200

>> OK, so Date$="xx.xx.xx" and Time$="xx.xx.xx". Now how do I set the
>> file's date-time stamp?

1. save the current time/date.
2. set the desired time/date.
3. open the file for binary.
4. read the first two bytes into an integer and write them back.
5. close the file.
6. reset the correct time/date.

------------------------------------------------------------------------
Chuck Stuart - Mesquite TX USA  
VBTrace 2.00 is a runtime Procedure Trace, XRef,
Debug, Profiler and much more. Shareware $49.
http://www.apexsc.com/vb/ftp/coop/cstuart
ftp.apexsc.com/pub/cgvb/coop/cstuart
------------------------------------------------------------------------



Thu, 19 Feb 1998 03:00:00 GMT  
 Need to set file date/time

Quote:

>> OK, so Date$="xx.xx.xx" and Time$="xx.xx.xx". Now how do I set the
>> file's date-time stamp?

>Open, Close.

        Thanks (was being stupid again. sorry - got it a second after I
hit the Send button but it was toio late...)

--
David Ullrich
Don't you guys find it tedious typing the same thing
after your signature each time you post something?
I know I do, but when in Rome...



Sat, 21 Feb 1998 03:00:00 GMT  
 Need to set file date/time

Quote:

>    I need to alter a file's date/time....

[snipsnip]

        Ok, ahem, ATTENTION, ONE AND ALL.  The correct answer is
"VBIO.ZIP", a freeware VBX from SheAr Software in the Netherlands (email

"~ftp/pub/pc/win3/programr/vbasic" and get "VBIO.ZIP".  It contains a
wonderful little VBX that performs all kinds of useful file and
directory-oriented operations, including setting a file's date & time
stamp.  Included is a HLP file.  
        Hats off to Arjen Broeze of SheAr!!  (I guess I don't have to tell
you to get the file via FTP and not bother the author with requests .....)

--
+--------------------------------+---------------------------+

|      "your storage answer"     |     "WTB : clever sig"    |
+--------------------------------+---------------------------+



Sun, 22 Feb 1998 03:00:00 GMT  
 Need to set file date/time

Quote:
Balchen jr.) writes:

>Subject: Re: Need to set file date/time
>Date: 3 Sep 1995 01:10:34 +0200

>> OK, so Date$="xx.xx.xx" and Time$="xx.xx.xx". Now how do I set the
>> file's date-time stamp?

>1. save the current time/date.
>2. set the desired time/date.
>3. open the file for binary.
>4. read the first two bytes into an integer and write them back.
>5. close the file.
>6. reset the correct time/date.

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    Times past! Repeated use of this technique lets the computer time lose
    :-)

--

+-----//-----------------------------------------------------------------+
|                                                                        |

| Brunnenstrasse 1                CIS-ID:   100010,2067                  |
| D-59514 Welver-Nateln (Germany) Tel.:     +49-2384-911012              |
+-----------------------------------------------------------------//-----+



Mon, 23 Feb 1998 03:00:00 GMT  
 Need to set file date/time

Quote:


> Balchen jr.) writes:

> >Subject: Re: Need to set file date/time
> >Date: 3 Sep 1995 01:10:34 +0200


> >> OK, so Date$="xx.xx.xx" and Time$="xx.xx.xx". Now how do I set the
> >> file's date-time stamp?

> >1. save the current time/date.
> >2. set the desired time/date.
> >3. open the file for binary.
> >4. read the first two bytes into an integer and write them back.
> >5. close the file.
> >6. reset the correct time/date.
>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>     Times past! Repeated use of this technique lets the computer time
>     lose

Instead save the time and another counter, like GetTickCount, and get the
difference afterwards so that you can reset the time properly.

Jens
--
* Everything I said are the opinions of someone else.   *
* I just cut-and-pasted.                                *

Jens Balchen jr.

P.O.Box 6052
N-4602 Kristiansand



Wed, 25 Feb 1998 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Get and set file date and time stamps

2. Setting a file date/time vb6?

3. Setting Date and Time of Files

4. How To: set file date & time created

5. Setting file date/time from Visual Basic

6. File Modification Date/Time - grabbing and setting

7. How to set File Modified Date/Time in VB App

8. Setting file date/time stamp

9. Setting File date/time

10. Setting File Date and Time

11. Setting File Date and Time

 

 
Powered by phpBB® Forum Software