Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UTC time without
Message
 
To
05/03/2004 15:23:45
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00883625
Message ID:
00883666
Views:
9
>>This last part sounds right. If you look at the code in GetFilesTime(), you'll notice calls to ConvertFileTime(). In that function, you'll see the following.
ldtresult = This.oConvert.FileToLocalTime(pcfiletile)
>>ldtresult = This.oConvert.FileTimeToSystem(ldtresult)
>>ldtresult = This.oConvert.SystemToDateTime(ldtresult)
What's retrieved in GetFilesTime() is UTC time. You'll note that there's no conversion calls in SetFilesTime(). This is because Windows handles it internally.
>
>And this is what hurts me. If I leave it as is, the above three lines cause the filetime to go to 01/01/1985 06:00:00.
>
>>If I wanted to set a file's time to show UTC plus 1 that's what I would pass it. However, if I wanted the actual timestamp to be UTC plus one, from Eastern Time, I'd simply add an hour.
>
>Actually, I had to take one hour off, because I'm storing the CentralEuropean times, and this call requires UTC.
>
>I think I've finally got it - by commenting the .SystemToDateTime call in ConvertFileTime AND commenting .LocalToDateTime in ConvertDateTime. Somehow these two cancel each other out and I'm getting the files with correct times and dates. Gee, even centuries are correct :).
>
>In the end, I'll have a stick-and-rope (I think it would be called "tin foil and chewing gum" in American terms) version control. It should be able to keep stuff in sync no matter which continent the programmer calls from, by keeping every timestamp tied to server's timezone.
>
>If ever we move the server, there'll be just one setting to change in the ini file :).

Dragan,

Glad you got it all straightened out. Shows how much I know my own stuff.< vbg > Hope you didn't have too much trouble getting it to work and that it's been worth the trouble.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform