[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

It's that time of year here.

BeeJ

11/6/2011 7:46:00 PM

So MS has screwed up my file system again.
We switched from Daylight Slavings time to Standard and all the
32Gigabytes (yes, 32G) of files on my USB drive are now 1 hour off.
So how do I tell if a file has changed?
This is my sneakernet drive. Plays havoc every time.

Well anyway, my questions is this.
1) How can my VB6 apps that rely on the date information consistency
find out if the PC is using Daylight vs Standard?

2) And, if I wanted to for some perverse logic want to programmatically
switch it, how?

3) Is there a way to get the PC files to revert to the previous time
without screwing with the calendar/clock settings?


15 Answers

Norm

11/6/2011 7:50:00 PM

0

BeeJ explained on 11/6/2011 :
> So MS has screwed up my file system again.
> We switched from Daylight Slavings time to Standard and all the 32Gigabytes
> (yes, 32G) of files on my USB drive are now 1 hour off.
> So how do I tell if a file has changed?
> This is my sneakernet drive. Plays havoc every time.
>
> Well anyway, my questions is this.
> 1) How can my VB6 apps that rely on the date information consistency find out
> if the PC is using Daylight vs Standard?
>
> 2) And, if I wanted to for some perverse logic want to programmatically
> switch it, how?
>
> 3) Is there a way to get the PC files to revert to the previous time without
> screwing with the calendar/clock settings?

BeeJ,

I could not resist this, move to Arizona where we do not use daylight
savings time. :-) Of course you could always just set the time on your
computer to Arizona.

Hopefully someone will come along and give you a sensible answer.

:-)

Norm


BeeJ

11/6/2011 8:01:00 PM

0

To make matters worse, I just discovered that Windows has actually
changed the DAY! on one of the files. My app checks for proper dates
on support files so my app reported an ERROR!

*{SystemPath}\mscal.ocx 8.0.0.5007 89,600
1998 06 25 ?Date? 1998 06 26 C:\WINDOWS\system32

The file shows 11:00 PM so it toggles around midnight.

Thanks MS!


P.S. Arizona is too dry for me.


Jim Mack

11/6/2011 9:41:00 PM

0

> So MS has screwed up my file system again.
> We switched from Daylight Slavings time to Standard and all the
> 32Gigabytes (yes, 32G) of files on my USB drive are now 1 hour off.

Convert the drive to NTFS if you want this to be a non-issue.

Nothing changed with the files themselves, just the interpretation of
the time stamp. FAT file systems can't deal with this, which is why
they're basically obsolete.

--
Jim


Wolfgang Enzinger

11/6/2011 10:23:00 PM

0

Jim Mack <no-uce-ube@mdxi.com> wrote:

>> So MS has screwed up my file system again.
>> We switched from Daylight Slavings time to Standard and all the
>> 32Gigabytes (yes, 32G) of files on my USB drive are now 1 hour off.
>
>Convert the drive to NTFS if you want this to be a non-issue.

That'd be the solution, actually, but it can't be applied to a USB drive if
I'm not mistaken?

Wolfgang

BeeJ

11/6/2011 11:14:00 PM

0

What I want to do is detect if Daylight Savings then adjust my date
comparison if it is a USB drive (removable drive). If this is possible
to do?
Any help figuring that out would be helpful.


Henning

11/6/2011 11:20:00 PM

0


"Wolfgang Enzinger" <we_usenet@nurfuerspam.de> skrev i meddelandet
news:0p1eb7h6ir2dlj7613iv7fk94ker70n2bt@4ax.com...
> Jim Mack <no-uce-ube@mdxi.com> wrote:
>
>>> So MS has screwed up my file system again.
>>> We switched from Daylight Slavings time to Standard and all the
>>> 32Gigabytes (yes, 32G) of files on my USB drive are now 1 hour off.
>>
>>Convert the drive to NTFS if you want this to be a non-issue.
>
> That'd be the solution, actually, but it can't be applied to a USB drive
> if
> I'm not mistaken?
>
> Wolfgang

http://www.ntfs.com/q...

/Henning


Jim Mack

11/6/2011 11:27:00 PM

0

> Jim Mack <no-uce-ube@mdxi.com> wrote:
>
>>> So MS has screwed up my file system again.
>>> We switched from Daylight Slavings time to Standard and all the
>>> 32Gigabytes (yes, 32G) of files on my USB drive are now 1 hour off.
>>
>> Convert the drive to NTFS if you want this to be a non-issue.
>
> That'd be the solution, actually, but it can't be applied to a USB drive
> if I'm not mistaken?

You can format a USB stick with NTFS -- all mine are, unless they're
used to exchange with systems (Mac, linux) that may not support NTFS.

But I don't know if the command-line 'convert' program can switch one
from FAT to NTFS without loss of data, the way it can for regular
drives.

--
Jim


Dee Earley

11/7/2011 11:19:00 AM

0

On 06/11/2011 23:14, BeeJ wrote:
> What I want to do is detect if Daylight Savings then adjust my date
> comparison if it is a USB drive (removable drive). If this is possible
> to do?
> Any help figuring that out would be helpful.

You can find the current offset using GetTimeZoneInformation() and
figuring out the offset.

Note that this will break again if timezone changes, or you run it
against anything that properly uses GMT like NTFS.

Just to reiterate all the other answers, this is happening because
you're using a obsolete and deprecated file system that is broken. The
correct resolution is to convert to a file system that's been updated
within in the last 15 years.

(Also note that Fat32 also has a 2s resolution to the time, which is yet
another reason you should not rely on modified times)

--
Dee Earley (dee.earley@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk...

iCode Systems

(Replies direct to my email address will be ignored.
Please reply to the group.)

(nobody)

11/7/2011 12:07:00 PM

0

"BeeJ" <nospam@spamnot.com> wrote in message
news:j96o5j$juo$1@speranza.aioe.org...
> So MS has screwed up my file system again.
> We switched from Daylight Slavings time to Standard and all the
> 32Gigabytes (yes, 32G) of files on my USB drive are now 1 hour off.
> So how do I tell if a file has changed?
> This is my sneakernet drive. Plays havoc every time.
>
> Well anyway, my questions is this.
> 1) How can my VB6 apps that rely on the date information consistency find
> out if the PC is using Daylight vs Standard?
>
> 2) And, if I wanted to for some perverse logic want to programmatically
> switch it, how?
>
> 3) Is there a way to get the PC files to revert to the previous time
> without screwing with the calendar/clock settings?

Don't use VB's FileDateTime function, which returns the local time, but use
GetFileTime() API function that returns the UTC date if the drive was
formatted using NTFS. Don't convert the date to local time, only when you
need to display it.


Thorsten Albers

11/7/2011 1:12:00 PM

0

BeeJ <nospam@spamnot.com> schrieb im Beitrag
<j974ca$l3n$1@speranza.aioe.org>...
> What I want to do is detect if Daylight Savings then adjust my date
> comparison if it is a USB drive (removable drive). If this is possible
> to do?
> Any help figuring that out would be helpful.

a) To get the time of the file use WinAPI: GetFileTime() which will give
you the time as Coordinated Universal Time (UTC) which is given without any
daylight saving biases.
b) To get the current time of the system on which the app works use as UTC
use WinAPI: GetSystemTime().

To compare the two time values use WinAPI: SystemTimeToFileTime() with b),
or WinAPI: FileTimeToSystemTime() with a).

--
Thorsten Albers

gudea at gmx.de