I need to filter an App Engine query by a date stamp that I've retrieved from a jsp as (strDatestamp)
. I know that the Datastore uses UTC time but I'm not sure how to account for this in my parsing. I've tried using Z
, but this hasn't worked.
String strDatestamp = req.getParameter("datestamp");
String myFormatString = "yyyy-MM-dd hh:mm:ss";
Date datestamp = null;
try {
datestamp = new SimpleDateFormat(myFormatString, Locale.ENGLISH).parse(strDatestamp);
} catch (ParseException e) {
e.printStackTrace();
}
Filter filter = new FilterPredicate("date", FilterOperator.EQUAL, datestamp);
Query query = new Query("Example", key)
.setFilter(filter);