/* Apollo11.kt Copyright (c) Kari Laitinen http://www.naturalprogramming.com 2020-10-31 File created. */ import java.time.LocalDate import java.time.Period fun main() { val date_of_discovery_of_america = LocalDate.of( 1492, 10, 12 ) val date_of_first_moon_landing = LocalDate.of( 1969, 7, 20 ) print( String.format( "\n Christopher Columbus discovered America on %1${'$'}tF" + "\n That was a %1${'$'}tA\n", date_of_discovery_of_america ) ) print( String.format( "\n Apollo 11 landed on the moon on %1${'$'}tF" + "\n That was a %1${'$'}tA\n", date_of_first_moon_landing ) ) val distance_between = date_of_discovery_of_america.until( date_of_first_moon_landing ) print( "\n\n America was discovered " + distance_between.getYears() + " years, " + distance_between.getMonths() + " months, and " + distance_between.getDays() + " days" + "\n before the first moon landing.\n\n" ) }