on-internet
← Community

Converting military time to Standard and Universal time in Java?

Stack Overflow ·

I'm currently getting the correct military time. What I'd like the program to display is something like 4:20:01 instead of 16:20:01 for standard time. I've tried using if statements, but I haven't been successful. I'm confused on Universal time. Would the Universal Time be the same as the military time? Or is it a separate thing? If so, how can I get the program to show the universal time? This is the current code I have: package readtime; import java.time.LocalDateTime; public class Time { // field data int hour; int minute; int second; public Time () { hour = 0; minute = 0; second = 0; } pub

Comments

Sign in or sign up to comment and upvote.

No comments yet.