我在執(zhí)行日期類型(時間戳)的查詢時遇到困難。在 cCoud 火庫中查詢?nèi)掌谧侄蔚恼_方法是什么? String created_view = editTextDataFilter.getText().toString(); String time_variable= ""; try { time_variable= new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH).format(new SimpleDateFormat( "dd/mm/yyyy", Locale.ENGLISH).parse(created_view)); }catch (ParseException e){}db.collection("Students") .whereGreaterThan("created_at", time_variable) .get() .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() { @Override public void onComplete(@NonNull Task<QuerySnapshot> task) { if (task.isSuccessful()) { for (QueryDocumentSnapshot document : task.getResult()) { alunosList.add( new Students( document.getString("name").toUpperCase(), document.getString("classroom"), document.getDate("created_at"))); recyclerView.setAdapter(adapter); } } else { Log.w(TAG, "Error getting documents.", task.getException()); } } });}字段時間戳我希望輸出將日期大于“time_variable”中輸入的值的記錄,但目前它找不到值。
封閉式火庫 - 使用日期類型的字段進行查詢
慕碼人2483693
2022-09-14 16:52:13