Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Server Time
Message
 
 
To
02/03/2001 05:26:31
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00475234
Message ID:
00481995
Views:
14
Vladimir,
As Will posted, it sounds like your server and workstations are set to different time zones. The NetRemoteTOD returns a Universal Coordinated Time (UTC/GMT) value. The SetSystemTime accepts this value and sets your clock accordingly. Windows then does all the calculations needed to display that time based on the time zone information entered. If your system shows 60 minutes off, then your time zones are configured 60 minutes apart from one another.

As for why the VFP code doesn't return what the VB code does, the DWORDtoNum function does not handle negative numbers in its current state. Replace the current return statement with the following IF statement and it will return the same as VB.
if ln3+ln2+ln1+ln0 < 2^31 then
	return ln3 + ln2 + ln1 + ln0
else
	return (-1)*((2^32)-(ln3 + ln2 + ln1 + ln0))
endif
HTH.

>>>Hi,
>>> I am using VFP as my front and back end. I would like to store the datetime of the record inserted in every table. However, I faced problem that, the time in every workstation may not the same. Any ways to ask VFP to store this field value using the date time of a particular workstation or the machine which the database located?
>>>
>>>Thank you
>>
>>John,
>>There are two ways to synchronize datetimes between workstations and servers.
>>
>>1. If both are NT/W2K systems, check out this FAQ. http://www.levelextreme.com/wconnect/wc.dll?UniversalThread~?2,33,12,617
>>
>>2. If the workstations are Win9X/ME you can create a file on the server using the low level file functions (LLFF) (fcreate) and use ADIR() to retrive the creation datetime from the array. The datetime will be determined by the server's time. You can then use the SetLocalTime WinAPI funtion to set the time.
>>
>>HTH.
>
>
>>> It is important to use the SetSystemtime and not SetLocalTime. NetRemoteTOD returns Greenwich Mean Time.
>>> If you used this time to set your local time, your clock would be off by the GMT offset for your time zone.
>
>I have a problem with this example. If I use "SetSystemtime" or "SetLocalTime" there is always difference with
>server (60 minute). If I try this example in Visual Basic "tod_timezone" always give me a number "-60". In Visual
>FoxPro I got "4294967236" number.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform