----- Original Message ----- 
From: "David Webb" <[EMAIL PROTECTED]>
Newsgroups: palm-dev-forum
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Friday, April 16, 2004 9:58 AM
Subject: Any known bugs in TimSetSeconds() ?


> I've been trying to figure out this bug for days and its driving me nuts.
>
> We have an app that communicates to the server wirelessly using the
Tungsten
> W's.  When they log in to the server, the server sends back the time as in
> seconds since 1904 as part of the response.  The palm uses this response
to
> call TimSetSeconds() with that value from the server immediately.
>
> Now occasionally, with some user's in the field, the Palm's time will get
> set exactly 1 day ahead of the correct date/time.  I log all responses
from
> the server and I know it is sending the correct time (in seconds)
everytime.
> I've traced the code in the app, and there is nothing going on that could
> cause this.  Its very direct and there are no date conversions - it takes
> the seconds string from the server, calls StrAToI and stores the value in
a
> UInt32, checks the value to see if it is reasonable (greater than
> 3000000000), then calls TimSetSeconds().  Its always off by exactly one
day
> though which is like 86400 seconds or something.
>
> Is there any know bugs that might do this?  The users in the field do not
> have the ROM upgrade for the TW's yet.

David,

I have some similar work like yours but on the reversed direction : the Palm
app sends its time back to a Unix server. Although my problem is not the
same like yours, but I would like to list what I met and fixed, just in
case:

1. I prevent using StrAToI because it convers to a signed interger. I don't
know if it converts correctly for time on PalmOS that is an unsigned int32
number.

Instead of using a string, I sent the time in seconds as an  int ( 4 bytes )
from the Unix host to the PalmOS dev. On PalmOS I cast it to an unsinged
int. By this way, I don't need to use the StrAToI.

2. I got an time shift of one day : it is because I calculated the wrong
leap days since 1904 until now.

Vu





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to