Start a new topic

android query by creation time

I know it is a trivial question. But I really can't find the answer from the Kinvey android document. Can anyone help? thank you very much. 


Hi Kevin,


What have you tried so far?



Regards,

Wani

Kinvey Support

 

Query q = mKinveyClient.query();
q.greaterThan("_kmd.ect",calendar.getTime().toString());

 

but I got know thing back

sorry for the typo, I mean I got nothing back

Hi Kevin,


Have you compared the output of calendar.getTime().toString() and the format of _kmd.ect field in Kinvey Console?



Regards,

Wani

I am querying using android, not business logic. but I didn't compared the output. In iOS, there are some special keys like "KCSMetadataFieldLastModifiedTime" for me to use, but I can't find anything in Android. 

I think I solve my problem.


i need to format the calender first

 

            SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.getDefault());
            String formatted = format1.format(calendar.getTime());

 

and then use

q.greaterThanEqualTo("_kmd.ect",formatted);

 

I think I solve my problem.


i need to format the calender first

 

            SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.getDefault());
            String formatted = format1.format(calendar.getTime());

 

and then use

q.greaterThanEqualTo("_kmd.ect",formatted);

 

Login or Signup to post a comment