1

I have a class called Events which contains a column called EventDate of type Date. In my query what format does the date need to be in to query successfully? The query succeeds, but always shows me 0 events. I have one event in my class which should match the criteria that has an EventDate value of Feb 14, 2014, 03:48. Below is a snippet of my code:

ParseQuery<ParseObject> query = ParseQuery.getQuery("Events");
query.whereGreaterThanOrEqualTo("EventDate", new Calendar.getInstance().getTime());
query.findInBackground(new FindCallback<ParseObject>() {

        @Override
        public void done(List<ParseObject> events, ParseException e) {
            if (e == null) {
                Log.d("Events", "Total Events:  " + events.size());
            } else {
                Log.d("Events", "Error:  " + e.getMessage());
            }

        }
    });
1
  • Date should be correct. Does your query work if you comment out the "whereGreaterThanOrEqualTo"-statement? Commented Feb 13, 2014 at 9:00

1 Answer 1

1

I figured out the issue. I was not aware that the date/time stored in my Parse class was stored in GMT time. When I convert the current local time to GMT time and send that I am able to get my query results.

Sign up to request clarification or add additional context in comments.

1 Comment

Can you please your sample code here, It will help other.. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.