Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Store dates are UNIX timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleconroy committed Mar 3, 2012
1 parent ca2a9b4 commit d91b9c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions osx/timesuck.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@
/* Begin PBXProject section */
95BDD6A5140B32FD00BF6B6B /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 95BDD6A8140B32FD00BF6B6B /* Build configuration list for PBXProject "timesuck" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
Expand Down
6 changes: 3 additions & 3 deletions osx/timesuck/timesuckAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ - (FMDatabase*)initDatabase
}

/* Create Table */
[database executeUpdate:@"CREATE TABLE IF NOT EXISTS logs (type TEXT, name TEXT, start TEXT, end TEXT, duration REAL)"];
[database executeUpdate:@"CREATE TABLE IF NOT EXISTS logs (type TEXT, name TEXT, start REAL, end REAL, duration REAL)"];

return database;
}
Expand All @@ -109,8 +109,8 @@ - (void)logForType:(NSString *)type name:(NSString *)name start:(NSDate *)start
[db executeUpdate:@"INSERT INTO logs VALUES (?,?,?,?,?)",
type,
name,
[dateFormatter stringFromDate:start],
[dateFormatter stringFromDate:end],
[NSNumber numberWithDouble:[start timeIntervalSince1970]],
[NSNumber numberWithDouble:[end timeIntervalSince1970]],
[NSNumber numberWithDouble:[end timeIntervalSinceDate:start]]];
}

Expand Down

0 comments on commit d91b9c9

Please sign in to comment.