0

I am trying to make use of this code firebase.database().ref('posts').startAt(currenttime - 84000000) To order my Recycleview to show post created within last 7 days.

If the 84000000 is the time in milliseconds how can I specify current time on java to be the current date?

  • Are you asking [how to convert milliseconds to date in java](https://www.google.com/search?q=how+to+convert+milliseconds+to+date+in+java)? – Frank van Puffelen Apr 07 '22 at 19:52
  • No, how can I get current time I want to subtract this with 7 days in milliseconds on my post Adapter so I can fetch post within that time range – osas divine Apr 07 '22 at 20:16
  • So [how to get the current time in java in milliseconds](https://www.google.com/search?q=how+to+get+the+current+time+in+java+in+milliseconds) then? From there, it seems like `System.currentTimeMillis()` should do the trick. – Frank van Puffelen Apr 07 '22 at 20:24
  • 1
    Gracias! That gives me a great direction to implement it. – osas divine Apr 07 '22 at 20:53

0 Answers0