Time Problem - Help Needed
Posted: Mon Feb 15, 2010 1:17 am
I wrote a utility that I use to determine whether I need to update a file or not.
The code in question is as follows:
Result = GetFileDate(zfile$,#PB_Date_Modified)
zdate$ = FormatDate("%mm/%dd/%yyyy", result)
ztime$ = FormatDate("%hh:%ii:%ss", result)
I then write zdate$+ztime$ to a text file that can be read from other programs that determine the need for an updated file.
Here is the problem: For some reason that is beyond me, the routine converts the time to GMT time, which in my case is 5 hours later! In some cases, it even causes a date change to the next day!
This is very strange and complicates my life, since to convert back, I would have to determine whether daylight saving time is in effect or not, plus deal with crossing dates, etc., all of which I don't want to do ... never had to do this before in other languages.
Has anyone else run into this? Why not return what is actually in the file, as reported by the file properties? Why do this conversion at all?
Any answers?
Thanks,
AussiePup (I'm in Chapel Hill, NC .. USA, which is currently Eastern StandardTime)
The code in question is as follows:
Result = GetFileDate(zfile$,#PB_Date_Modified)
zdate$ = FormatDate("%mm/%dd/%yyyy", result)
ztime$ = FormatDate("%hh:%ii:%ss", result)
I then write zdate$+ztime$ to a text file that can be read from other programs that determine the need for an updated file.
Here is the problem: For some reason that is beyond me, the routine converts the time to GMT time, which in my case is 5 hours later! In some cases, it even causes a date change to the next day!
This is very strange and complicates my life, since to convert back, I would have to determine whether daylight saving time is in effect or not, plus deal with crossing dates, etc., all of which I don't want to do ... never had to do this before in other languages.
Has anyone else run into this? Why not return what is actually in the file, as reported by the file properties? Why do this conversion at all?
Any answers?
Thanks,
AussiePup (I'm in Chapel Hill, NC .. USA, which is currently Eastern StandardTime)