因为sqlite为弱引用,使用字段前将他强制转为日期型,用datetime.或者最原始的 strftime. SELECT distinct ID from testTable where datetime(availDate) between datetime('2015-01-12 04:00') and datetime('2015-01-13 00:00'); SQLite日期时间函数 SQLite支持以下五个日期时间函数: date(timestring, modifier, modi…
public class TimeTwo { public static void main(String[] args) throws ParseException{ String s = "2018-08-12 12:02:23"; //使用SimpleDateFormat实现字符串和日期的相互转换 SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFor…
1. String类型 String类源码 为了从本质上理解String类型的特性所在,我们从String类型的源码看起,在源码中String类的注释中存在以下: /**Strings are constant; their values cannot be changed after they * are created. String buffers support mutable strings. * Because String objects are immutable they ca…