-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtime.java
More file actions
28 lines (22 loc) · 927 Bytes
/
Copy pathtime.java
File metadata and controls
28 lines (22 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.Scanner;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
public class time{
public static void main(String[] args) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
LocalTime date = LocalTime.now();
System.out.println(date.format(formatter));
System.out.println("Your timezone: pst, est, cst, mst, utc, gmt ");
Scanner userInput = new Scanner(System.in);
String timezone = userInput.nextLine();
System.out.println("Enter timezone converting to: pst, est, cst, mst, utc, gmt ");
String convertTo = userInput.nextLine();
switch(timezone){
case "pst":
if(convertTo == "est"){
}
break;
}
}
}