Tag: timedifference

  • How to measure time in a single unit of time in Java?

    Let’s say you want to find out the number of weeks since your birthday , or the number of decades , or the number of hours . And you want to do this in a single line of code. Java 8 allows you to do that. It provides an API named ChronoUnit under java.time.temporal package…