比较存储与使用时间字符串日期 [英] Compare Dates Stored as String using Datetime

查看:171
本文介绍了比较存储与使用时间字符串日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

这篇关于比较存储与使用时间字符串日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆