Java 我只想要日期,但要作为时间戳,以在CREATE_Timestamp上查询数据

Java 我只想要日期,但要作为时间戳,以在CREATE_Timestamp上查询数据,java,ptc-windchill,Java,Ptc Windchill,我在CREATE\u TIMESTAMP的基础上使用QuerySpec查询日期,下面是我的一段代码,编译器说CREATE\u TIMESTAMP是TIMESTAMP,而day是字符串。我尝试了很多方法,但没有锻炼 Date date=new Date(); SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd"); String day=format.format(date); qs.appendWhere(new SearchCond

我在
CREATE\u TIMESTAMP
的基础上使用QuerySpec查询日期,下面是我的一段代码,编译器说
CREATE\u TIMESTAMP
TIMESTAMP
,而
day
是字符串。我尝试了很多方法,但没有锻炼

Date date=new Date();
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
String day=format.format(date);
qs.appendWhere(new SearchCondition(QueueEntry.class,
                                   QueueEntry.CREATE_TIMESTAMP,
                                   SearchCondition.LIKE,day), 
                                   new int[] {0,1});

你为什么不用时间戳呢?另外:为什么要使用
SearchCondition.LIKE
而不是
SearchCondition.EQUALS
?你想实现什么?我实际上想查询条目,只按日期过滤,这在时间戳上是不可能的,所以我用java api代替WC api,自己写了quey…改变了会话,得到了我想要的,谢谢你的回复