Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • In which timezone? Commented Mar 5, 2018 at 15:06
  • Possible duplicate of How to get time and Date from datetime stamp Commented Mar 5, 2018 at 15:07
  • 4
    You can get rid of the date part by taking the modulo with the number of millis seconds in a one day, System.currentTimeMillisd() % 86400000L Commented Mar 5, 2018 at 15:17
  • 1
    @DavidZimmerman Much easier to use the java.time class, and more obvious with self-documenting code. Commented Mar 5, 2018 at 17:36
  • 4
    Dear down-voters, please leave a criticism along with your vote. If you think this is a duplicate, find the original. I tried but could not find any other. So I am up-voting here. Commented Mar 5, 2018 at 17:39