localtime function returns different values for different winnt operating systems 
Author Message
 localtime function returns different values for different winnt operating systems

Hi,

I have a small application with the following codes:

.....
  time_t  ltime;
  time   (&ltime);
  localtime(&ltime);
  printf("current time in number of seconds: %d\n", ltime);
......

I have two different winnt systems, they are both set to Tokyo time zone,
the same day and the same time. The only difference is that one is winnt
English version, the other one is winnt Japanese version. At Nov 14, 2000
06:36:16,  I ran the above codes at the same time, it gave me two different
results:
+ On the winnt English version:
   current time in number of seconds = 974151376
+ On the winnt Japanese version:
   current time in number of seconds = 974212576

The difference = 61200 which is about 17 hours difference.

Any one know why?

Thanks,
HHuynh



Fri, 02 May 2003 03:00:00 GMT  
 localtime function returns different values for different winnt operating systems
<snip>

Quote:
> + On the winnt English version:
>    current time in number of seconds = 974151376
> + On the winnt Japanese version:
>    current time in number of seconds = 974212576

> The difference = 61200 which is about 17 hours difference.

> Any one know why?

You probably have an outdated C run-time library (msvcrt.dll) on one
of them.  Try again with the version that comes in the latest Visual
Studio service pack.  There have been lots of bug fixes in the time
functions.  (There are probably lots of bugs still there.  In
particular they can never get daylight savings calculations right; you
might be better off using OS functions instead.)

By the way, the default time-zone for Microsoft software is Pacific
(to suit Redmond).  Tokyo is 17 hours ahead of Redmond.

--
Any opinions expressed are my own and not necessarily those of Roundpoint.



Sat, 03 May 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. GetCommTimeouts is returns different values on different ports

2. Help - Calling ActiveX DLL function from VB and C++ returns different values

3. Graphics in different Operating Systems

4. .NET on different operating systems

5. Different value when converting into different type

6. Why different run on different systems??

7. Why different run on different system?

8. Why different run on different system?

9. GetCurSel() for a CComboBox is returns 2 different values on consecutive calls

10. GetClientRect returns different values each time app is run

11. Virtual Function with Different Return Type

12. Overloading function prob with different return types

 

 
Powered by phpBB® Forum Software