比较存储与使用时间字符串日期字符串、日期、时间

2023-09-07 12:17:02 作者:短腿猫不吃鱼

我已保存日期日期字符串在我下面的格式数据库:

I have stored dates' date as String in my database in the following format :

 dateFormater = new SimpleDateFormat("dd MMM yyyy");

现在我需要访问这两个日期 startWeekDate endWeekDate 无论格式化为上面的数据。目前,在 where子句 我的查询是:

Now i need to access data between the two dates startWeekDate and endWeekDate both formatted as above. Currently , the where clause of my query is :

at_date BETWEEN Datetime( '"+startWeekDate+"') AND Datetime( '"+endWeekDate+"')

其中startWeekDate是 '10 2014年8月和endWeekDate是 '16 2014年8月。但我让我的的TextView 空的结果。任何一个可以指导我怎样才能做到这一点。

Where startWeekDate is '10 Aug 2014' and endWeekDate is '16 Aug 2014'. But I am getting the null result on my TextView. Can any one guide me how can i do this.

推荐答案

这是不是之一支持的日期格式。

只需使用 YYYY-MM-DD