conversion to FILETIME

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

conversion to FILETIME

Eric Winger-4
In trying to coerce a st TimeStamp object to an external FILETIME, I
found the following anomoly: (The results at the time of my running are
in quotes)

ts := TimeStamp current.
ft := ts asParameter asFILETIME.
ts inspect. "10:16:23 AM, Friday, November 16, 2001" - in WA state, USA
ft inspect. "a LocalFILETIME(11/16/01 6:16:23 PM)"

As you can see, the FILETIME time is not the same. That's because ft's
in UTC time. Which is fine, but I wouldn't expect ft to be a
LocalFILETIME. Then converting it back to a TimeStamp via:

ft asSYSTEMTIME asTimeStamp "a LocalFILETIME(11/16/01 6:16:23 PM)"

would result the time in UTC.

It seems to me that the problem is in

fromSYSTEMTIME: aSYSTEMTIME
        "Answer a file time from the specified SYSTEMTIME (assumed to be in
        local time)."

        ^(LocalFILETIME fromSYSTEMTIME: aSYSTEMTIME) asUTC

Why would the FILETIME be created as a LocalFILETIME and then converted
to UTC? This would explain why the - ft asLocalTime - comes back as UTC
time.

btw - am running NT 4.0 & D4. I also checked the newsgroup archives and
didn't see a mention of this before.

thx much,

Eric


Reply | Threaded
Open this post in threaded view
|

Re: conversion to FILETIME

Blair McGlashan
Eric

"Eric Winger" <[hidden email]> wrote in message
news:[hidden email]...
> In trying to coerce a st TimeStamp object to an external FILETIME, I
> found the following anomoly...

Thanks for the bug report. On cursory examination I think the problem here
is that the method LocalFILETIME>>asUTC is implemented as:

    ^self class fromLocalTime: self

But should be implemented as:
       ^FILETIME fromLocalTime: self

I think this was broken when an attempt was made to remove a circular ref.
between the FILETIME and LocalFILETIME classes, which meant that those two
classes could never be stripped from a deployed image, probably in the D4
release.

(Note that in D4 that FILETIMEs always print/display in local time, even if
stored in UTC).

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: conversion to FILETIME

Eric Winger-4
thx for looking at that

Blair McGlashan wrote:

> Eric
>
> "Eric Winger" <[hidden email]> wrote in message
> news:[hidden email]...
>
>>In trying to coerce a st TimeStamp object to an external FILETIME, I
>>found the following anomoly...
>>
>
> Thanks for the bug report. On cursory examination I think the problem here
> is that the method LocalFILETIME>>asUTC is implemented as:
>
>     ^self class fromLocalTime: self
>
> But should be implemented as:
>        ^FILETIME fromLocalTime: self
>
> I think this was broken when an attempt was made to remove a circular ref.
> between the FILETIME and LocalFILETIME classes, which meant that those two
> classes could never be stripped from a deployed image, probably in the D4
> release.
>
> (Note that in D4 that FILETIMEs always print/display in local time, even if
> stored in UTC).
>
> Regards
>
> Blair
>
>
>