Hi, I have a sqlite3 database storing some time information as the time interval since 1970 as a REAL type. To get the total time interval since for example the beginning of this week I use something like the following.
const char *sql = "SELECT SUM(end - begin) FROM table WHERE begin>?"; sqlite3_prepare_v2(database, sql, -1, &sql_statement, NULL); double one_week = [[NSDate dateWithNaturalLanguageString:@"last monday 00:00 "] timeIntervalSince1970]; sqlite3_bind_int(sql_statement, 1, one_week); Though the method dateWithNaturalLanguageString is described as "It may give unexpected results, and its use is strongly discouraged.". Is there a better way for me to get e.g. the dates from my database from this week, this month etc.? Thank you very much, David _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]