-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are Timestamp correct? #13
Comments
I noticed this too. The formula in the code equates to 978285600. Using MySQL to figure out the right number gives me:
That's 6 hours difference. Using sqllite3 gives a different answer though, 11 hours different:
I recompiled the binary with both values, changed the code so it bucketed the data points by day instead of week, and it still seems to be 1 day off (comparing to my calendar so I know where I was on a particular day). I suppose the way to tell for sure (apart from asking Apple) is to look at the data on a phone where the exact activation time is known. Thoughts? |
My timestamps (as displayed on iPhoneTracker) are off by a few years! Places dated in 2010 actually should be 2006! |
|
It's very possible our displayed timestamps are off by a few hours, since I On Wed, Apr 20, 2011 at 8:03 PM, kurisutofu <
|
No need to use any approximation or self defined constant ... I was curious what the exact, time zone neutral, and constant value might be and figured there already is a constant defined "NSTimeIntervalSince1970". So "iOSToUnixOffset" can be removed and unixTimestamp calculated like this: const float unixTimestamp = (timestamp+NSTimeIntervalSince1970); To even simplify the code one could replace const float timestamp = [timestamp_number floatValue]; with const float unixTimestamp = [[NSDate dateWithTimeIntervalSinceReferenceDate:[timestamp_number floatValue]] timeIntervalSince1970]; deleting "iOSToUnixOffset" and later "unixTimestamp" definition. But I have not idea if this heavy "NSDate" instantiation and initialization affect performance significantly. I'd think so but haven't measured yet. |
Could someone do a print of NSTimeIntervalSince1970's value please? |
Apple documentation at states #define NSTimeIntervalSince1970 978307200.0 Programmatically using [NSString stringWithFormat:@"%f", NSTimeIntervalSince1970] gives
HTH. |
ok Thanks! |
Hi,
I couldn't use the application yet as I'm not on my Mac but I have extracted the database file from my iPhone and took a look at it with a sqlite database browser.
I could see the timestamp is not standard and after checking the source code here, I could see the comment in the code saying Apple seems to start from January 2001 instead of the unix January 1970.
In the sql query, I used the same addition than in the source code (31_365.25_24_60_60) but the results seem to be off a little (a few hours).
Going to the website http://calendarhome.com/, I got that between January 1970 and January 2001, there are 978307200 seconds and so I added those instead.
Now I seem to get something closer to reality for the timestamp.
Do you people who used the app get correct timestamps?
The text was updated successfully, but these errors were encountered: