Languages
[Edit]
EN

Java - time units enum example (ChronoUnit)

1 points
Created by:
Flimzy
356

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   );
    }
}

 

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.

❤️💻 🙂

Join