Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write a description of class TampilanJam here.
- *
- * @author Daffa Tristan Firdaus
- * @version 22 Oktober 2020
- */
- import java.time.format.DateTimeFormatter;
- import java.time.LocalDateTime;
- public class TampilanJam
- {
- public static void main(String[] args)
- {
- LocalDateTime now = LocalDateTime.now();
- DateTimeFormatter dateNow = DateTimeFormatter.ofPattern("dd/MM/yyyy");
- DateTimeFormatter timeNow = DateTimeFormatter.ofPattern("HH:mm");
- System.out.println("Jam");
- System.out.println(timeNow.format(now));
- System.out.println("");
- System.out.println("Tanggal");
- System.out.println(dateNow.format(now));
- WaktuAdzan time = new WaktuAdzan();
- System.out.println ("");
- System.out.println ("Imsak Shubuh Dzuhur Ashar Maghrib Isya ");
- System.out.println (time.getImsak() +" "+ time.getShubuh() +" "+ time.getDzuhur()
- +" "+ time.getAshar() +" "+ time.getMaghrib() +" "+ time.getIsya());
- RunningText text = new RunningText();
- System.out.println ("");
- if(timeNow.format(now).equals(time.getImsak()))
- {
- System.out.println(text.imsak());
- }
- else if(timeNow.format(now).equals(time.getShubuh()))
- {
- System.out.println(text.shubuh());
- }
- else if(timeNow.format(now).equals(time.getDzuhur()))
- {
- System.out.println(text.dzuhur());
- }
- else if(timeNow.format(now).equals(time.getAshar()))
- {
- System.out.println(text.ashar());
- }
- else if(timeNow.format(now).equals(time.getMaghrib()))
- {
- System.out.println(text.maghrib());
- }
- else if(timeNow.format(now).equals(time.getIsya()))
- {
- System.out.println(text.isya());
- }
- else
- {
- System.out.println(text.blank());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment