mobile app activity
mobile app activity
Technology
School of Commerce and Accountancy
Section: QC-A
Acctivity
import java.time.ZoneId
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
fun main() {
"USA" to "America/New_York",
"India" to "Asia/Kolkata",
"Japan" to "Asia/Tokyo",
"Germany" to "Europe/Berlin",
"Australia" to "Australia/Sydney"
println("$country: ${currentTime.format(formatter)}")
println("\nEnter the names of two countries from the list (e.g., USA, India, Japan, Germany,
Australia):")
println("\nTime gap between $country1 and $country2: $hours hours, $minutes minutes, $seconds
seconds")
} else {
println("Invalid country names entered. Please ensure they are from the list.")
output
Time for different countries:
USA: 13:47:22
India: 00:17:22
Japan: 03:47:22
Germany: 19:47:22
Australia: 05:47:22
Enter the names of two countries from the list (e.g., USA, India, Japan, Germany, Australia):
India
Japan
Time gap between India and Japan: 8 hours, 30 minutes, 0 seconds