Alternative to NSDate's dateWithNaturalLanguageString: ?
Alternative to NSDate's dateWithNaturalLanguageString: ?
- Subject: Alternative to NSDate's dateWithNaturalLanguageString: ?
- From: "David Arve" <email@hidden>
- Date: Mon, 30 Jun 2008 09:29:38 +0200
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 (email@hidden)
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:
This email sent to email@hidden