Advertisement
lamaulfarid

ClockDisplay

Oct 21st, 2020
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.43 KB | None | 0 0
  1.  
  2. /**
  3.  * Write a description of class ClockDisplay here.
  4.  *
  5.  * @author Ahmad Lamaul Farid
  6.  * @version 21 Oktober 2020
  7.  */
  8.  
  9. /**
  10.  * function to call current date.  
  11.  */
  12. import java.time.format.DateTimeFormatter;
  13.  
  14. /**
  15.  * function to call local time.
  16.  */
  17. import java.time.LocalDateTime;
  18.  
  19. public class ClockDisplay
  20. {
  21.     public static void main(String[] args)
  22.     {    
  23.         LocalDateTime now = LocalDateTime.now();
  24.        
  25.         System.out.println("======= Jadwal Waktu Sholat =======");
  26.         System.out.println("Date : ");
  27.         DateTimeFormatter dateNow = DateTimeFormatter.ofPattern("dd/MM/yyyy");
  28.         System.out.println(dateNow.format(now));
  29.          
  30.         System.out.println("Time : ");
  31.         DateTimeFormatter timeNow = DateTimeFormatter.ofPattern("HH:mm:ss");
  32.         System.out.println(timeNow.format(now));
  33.          
  34.         PrayerTime time = new PrayerTime();
  35.        
  36.         System.out.println ("Imsak     :" + time.getImsak());  
  37.         System.out.println ("Shubuh     :" + time.getShubuh());
  38.         System.out.println ("Terbit     :" + time.getTerbit());
  39.         System.out.println ("Dhuha     :" + time.getDhuha());
  40.         System.out.println ("Dhuhur     :" + time.getDhuhur());
  41.         System.out.println ("Ashar      :" + time.getAshar());
  42.         System.out.println ("Maghrib    :" + time.getMaghrib());
  43.         System.out.println ("Isya'      :" + time.getIsya());
  44.     }
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement