Simulator time doesn't reflect host time | developer.brewmp.com Simulator time doesn't reflect host time | developer.brewmp.com

Developer

Simulator time doesn't reflect host time

Forums:

If I run the following code in the simulator:

 

ISysClock_GetTimeS(pTime, &nSecs);

ISHELL_GetJulianDate(pIShell, nSecs, &dateTime);

 

Then dateTime is 2011 / 9 / 8 / 22 / 12 / 36

 

When the date time of the host OS is 2011 / 9 / 8 / 15 / 12 / 36

 

Why is the simulator 7 hours ahead? How can I rectify this?

Juliandate?  
represents seconds since January 6 1980 00:00:00 GMT

Juliandate?  
represents seconds since January 6 1980 00:00:00 GMT

Whats your point?
 
The documentation for ISHell_GetJulianDate() says: "This function fills a JulianType data structure based on the input second value. This value represents the number of seconds since January 6 1980 00:00:00 GMT, the device reference time".
 
The input I am passing to ISHell_GetJulianDate() is the number of seconds obtrained from
ISysClock_GetTimeS().
IShell_GetJulianDate() is correctly converting from elapsed seconds to the JilianType (which is just an AEEDateTime), however it is offset by 7 hours. Thus ISysClock_GetTimeS() is returning a value that is offset by 7 hours.
The whole point of my question is why is it offset by 7 hours.
 
 
 
 

Whats your point?
 
The documentation for ISHell_GetJulianDate() says: "This function fills a JulianType data structure based on the input second value. This value represents the number of seconds since January 6 1980 00:00:00 GMT, the device reference time".
 
The input I am passing to ISHell_GetJulianDate() is the number of seconds obtrained from
ISysClock_GetTimeS().
IShell_GetJulianDate() is correctly converting from elapsed seconds to the JilianType (which is just an AEEDateTime), however it is offset by 7 hours. Thus ISysClock_GetTimeS() is returning a value that is offset by 7 hours.
The whole point of my question is why is it offset by 7 hours.
 
 
 
 

Adding some comparative code, running this:
JulianType jType;
ISHELL_GetJulianDate(pIShell, 0, &jType); 
jType will contain 2011 / 9 / 12 / 8 / 48 / 17 and the clock on my host os says the time is 8:48 am. So everything is fine. However running this code:
uint32 Secs = 0;
ISysClock_GetTimeS(pTime, &Secs);
ISHELL_GetJulianDate(pIShell, Secs, &jType); 
Then jType contains 2011 / 9 / 12 / 15 /48 / 17 i.e. the time is not 8:48 am as above but 3:48pm.
 
So obviously _SysClock_GetTimeS must be getting the time in UTC. Well then it would help if the documentation said so, this is what it says: "Obtains the number of seconds elapsed since epoch and the validity of the clock. If the input uint32 parameter is NULL, the function only returns the validity of time and not the current value. The definition of validity is implementation specific."
 
What does that even mean, this isn't even an English sentence: "Obtains the number of seconds elapsed since epoch and the validity of the clock".
 
"and the validity of the clock" makes no grammatical sense in the context of that sentence. Grammer aside, what is it trying to say?
 
Where is UTC mentioned?
 
 

Adding some comparative code, running this:
JulianType jType;
ISHELL_GetJulianDate(pIShell, 0, &jType); 
jType will contain 2011 / 9 / 12 / 8 / 48 / 17 and the clock on my host os says the time is 8:48 am. So everything is fine. However running this code:
uint32 Secs = 0;
ISysClock_GetTimeS(pTime, &Secs);
ISHELL_GetJulianDate(pIShell, Secs, &jType); 
Then jType contains 2011 / 9 / 12 / 15 /48 / 17 i.e. the time is not 8:48 am as above but 3:48pm.
 
So obviously _SysClock_GetTimeS must be getting the time in UTC. Well then it would help if the documentation said so, this is what it says: "Obtains the number of seconds elapsed since epoch and the validity of the clock. If the input uint32 parameter is NULL, the function only returns the validity of time and not the current value. The definition of validity is implementation specific."
 
What does that even mean, this isn't even an English sentence: "Obtains the number of seconds elapsed since epoch and the validity of the clock".
 
"and the validity of the clock" makes no grammatical sense in the context of that sentence. Grammer aside, what is it trying to say?
 
Where is UTC mentioned?