Java - time units enum example (ChronoUnit)

1 points
Created by:

Quick example:

import java.time.temporal.ChronoUnit;

public class TimeUnitsExample {

    public static void main(String[] args) {
        System.out.println( ChronoUnit.NANOS   );
        System.out.println( ChronoUnit.MICROS  );
        System.out.println( ChronoUnit.MILLIS  );
        System.out.println( ChronoUnit.SECONDS );
        System.out.println( ChronoUnit.MINUTES );
        System.out.println( ChronoUnit.HOURS   );
        System.out.println( ChronoUnit.DAYS    );
        System.out.println( ChronoUnit.WEEKS   );
        System.out.println( ChronoUnit.MONTHS  );
        System.out.println( ChronoUnit.YEARS   );


Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂