{
}
Online Python Compiler
Online R Compiler
Online SQL Editor
Online HTML/CSS Editor
Online Java Compiler
Online C Compiler
Online C++ Compiler
Online C# Compiler
Online JavaScript Compiler
Online Typescript Compiler
Typescript Online Compiler
Online GoLang Compiler
Online Rust Compiler
Scala Online Compiler
Dart Online Compiler
Ruby Online Compiler
Online PHP Compiler
Online Swift Compiler
Generating Link
Generating Link
Share your code
Share code
Copy Link
Copied to clipboard
or share using
BLACK
NOVEMBER
Ends in
Get 66% off PRO
Ends in
Are you struggling to build your coding confidence or land your first job?
Fast-track to your first pay-check.
Ends in
Start PRO
Start PRO
BLACK
NOVEMBER
Ends in
Get 66% off PRO
Ends in
Are you struggling to build your coding confidence or land your first job?
Fast-track to your first pay-check.
Ends in
Start PRO
Start PRO
Online Java Compiler
Learn Python App
Learn Python
Main.java
Output
Main.java
Share
Run
Run
// Online Java Compiler // Use this editor to write, compile and run your Java code online import java.time.LocalDate; import java.time.Period; import java.time.temporal.ChronoUnit; class Main { public static void main(String[] args) { LocalDate startLocalDate = LocalDate.of(1975, 5 , 23); LocalDate endLocalDate = LocalDate.now(); Period peroidBetween = Period.between(startLocalDate , endLocalDate); System.out.println(peroidBetween.getYears()+" Years"); System.out.println(peroidBetween.getMonths()+" Months"); System.out.println(peroidBetween.getDays()+" Days"); long totalDays = ChronoUnit.DAYS.between(startLocalDate , endLocalDate); System.out.println("totalDays:"+totalDays+" Days"); } }
Output
Clear