fork download
  1. // from https://i...content-available-to-author-only...e.com/TaR29j
  2. /* package whatever; // don't place package name! */
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.util.Date;
  7. import java.text.SimpleDateFormat;
  8. import java.text.*;
  9.  
  10. /* Name of the class has to be "Main" only if the class is public. */
  11. class TimeSheet
  12. {
  13. public static void main (String[] args) throws java.lang.Exception
  14. {
  15. //Scanner myObj = new Scanner(System.in); // Create a Scanner object
  16.  
  17. Scanner myObj = new Scanner(System.in); // use myObj so you don't have to change it if you choose to use hard-wired inputs
  18.  
  19. // https://w...content-available-to-author-only...t.com/how-to-format-date-using-printf-method-in-java
  20. Date dateObj = new Date();
  21.  
  22. // https://stackoverflow.com/posts/39066917/revisions
  23. SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM d, yyyy");
  24.  
  25. System.out.println("From \"https://c...content-available-to-author-only...e.com/pwm/action/mobileGetTimesheetPunches\"");
  26.  
  27. //stackoverflow/questions/2296685/how-to-read-input-with-multiple-lines-in-java
  28. //stackoverflow/questions/56887493/how-to-take-multi-line-input-in-java search:HashmatWarrior
  29. while(myObj.hasNext())
  30. {
  31. String gottaFix = myObj.nextLine();
  32. String[] dateString = new String[2];
  33. String header = "Type Status Time Hours";
  34. String hours;
  35. String[] punch = new String[4];
  36.  
  37. if(!gottaFix.isEmpty())
  38. {
  39. if(gottaFix.contains("Punches:"))
  40. {
  41. dateString = gottaFix.split(": ");
  42. dateObj = sdf.parse(dateString[1]);
  43.  
  44. System.out.printf("%ta", dateObj); // Sun
  45. System.out.printf(" %tm", dateObj); // date
  46. System.out.printf("/%te", dateObj); // date
  47.  
  48. System.out.print(", scheduledTime");
  49.  
  50. /*System.out.printf("Date: %td%n", dateObj); System.out.printf("Month: %tm%n", dateObj); System.out.printf("Year: %ty%n", dateObj); System.out.printf("getTime(): "+dateObj);*/
  51. }
  52.  
  53. else if(gottaFix.contains("M"))
  54. {
  55. punch = gottaFix.split("\t");
  56. System.out.print(", ");
  57. System.out.print(punch[3].replaceAll(" \\DM", ""));
  58.  
  59. if(punch[0].equals("ES"))
  60. {
  61. if(punch[1].equals("Edited"))
  62. { System.out.println("/, (bank run); ");}
  63. else
  64. { System.out.println(", no bank run; ");}
  65. }
  66. }
  67. }
  68.  
  69. //else
  70. {
  71.  
  72. }
  73. }
  74. }
  75. }
Success #stdin #stdout 0.3s 61052KB
stdin
Punches: Sun Nov 2, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	4:37 PM	4:45
SB	03660	Normal	9:22 PM	0:12
EB	03660	Normal	9:34 PM	0:43
ES	03660	Normal	10:17 PM	
Punches: Mon Nov 3, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:39 PM	3:45
SB	03660	Normal	9:24 PM	0:10
EB	03660	Added	9:34 PM	0:55
ES	03660	Normal	10:29 PM	
Punches: Tue Nov 4, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	4:50 PM	4:35
SB	03660	Normal	9:25 PM	0:11
EB	03660	Normal	9:36 PM	0:52
ES	03660	Normal	10:28 PM	
Punches: Fri Nov 7, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:38 PM	4:25
SB	03660	Normal	10:03 PM	0:11
EB	03660	Normal	10:14 PM	0:23
ES	03660	Normal	10:37 PM	
Punches: Sat Nov 8, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:32 PM	4:31
SB	03660	Normal	10:03 PM	0:11
EB	03660	Normal	10:14 PM	0:13
ES	03660	Normal	10:27 PM	
Punches: Sun Nov 9, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	4:36 PM	4:57
SB	03660	Normal	9:33 PM	0:12
EB	03660	Normal	9:45 PM	0:29
ES	03660	Normal	10:14 PM	
Punches: Mon Nov 10, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:27 PM	4:07
SB	03660	Normal	9:34 PM	0:10
EB	03660	Added	9:44 PM	0:43
ES	03660	Normal	10:27 PM	
Punches: Tue Nov 11, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:18 PM	4:00
SB	03660	Normal	9:18 PM	0:17
EB	03660	Normal	9:35 PM	0:52
ES	03660	Normal	10:27 PM	
Punches: Fri Nov 14, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:31 PM	4:24
SB	03660	Normal	9:55 PM	0:14
EB	03660	Normal	10:09 PM	0:27
ES	03660	Normal	10:36 PM	
Punches: Sat Nov 15, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:26 PM	4:36
SB	03660	Normal	10:02 PM	0:18
EB	03660	Normal	10:20 PM	0:19
ES	03660	Normal	10:39 PM	
Punches: Sun Nov 16, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	4:44 PM	5:07
SB	03660	Added	9:51 PM	0:10
EB	03660	Normal	10:01 PM	0:14
ES	03660	Normal	10:15 PM	
Punches: Mon Nov 17, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:41 PM	3:41
SB	03660	Normal	9:22 PM	0:10
EB	03660	Added	9:32 PM	0:54
ES	03660	Normal	10:26 PM	
Punches: Tue Nov 18, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:17 PM	4:30
SB	03660	Normal	9:47 PM	0:14
EB	03660	Normal	10:01 PM	0:31
ES	03660	Normal	10:32 PM	
Punches: Fri Nov 21, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:32 PM	4:36
SB	03660	Normal	10:08 PM	0:10
EB	03660	Added	10:18 PM	0:59
ES	03660	Normal	11:17 PM	
Punches: Sat Nov 22, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:26 PM	4:39
SB	03660	Normal	10:05 PM	0:12
EB	03660	Normal	10:17 PM	0:30
ES	03660	Normal	10:47 PM	
Punches: Sun Nov 23, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	3:57 PM	6:05
SB	03660	Normal	10:02 PM	0:11
EB	03660	Normal	10:13 PM	0:13
ES	03660	Normal	10:26 PM	
Punches: Mon Nov 24, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:36 PM	4:24
SB	03660	Normal	10:00 PM	0:12
EB	03660	Normal	10:12 PM	0:28
ES	03660	Normal	10:40 PM	
Punches: Tue Nov 25, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	4:57 PM	5:07
SB	03660	Normal	10:04 PM	0:11
EB	03660	Normal	10:15 PM	0:17
ES	03660	Normal	10:32 PM
Punches: Thu Nov 27, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	12:18 PM	4:33
SB	03660	Normal	4:51 PM	0:11
EB	03660	Normal	5:02 PM	0:29
ES	03660	Normal	5:31 PM	
Punches: Fri Nov 28, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:30 PM	4:35
SB	03660	Normal	10:05 PM	0:18
EB	03660	Normal	10:23 PM	0:29
ES	03660	Normal	10:52 PM	
Punches: Sat Nov 29, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:19 PM	4:44
SB	03660	Normal	10:03 PM	0:11
EB	03660	Normal	10:14 PM	0:22
ES	03660	Normal	10:36 PM	
Punches: Sun Nov 30, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:13 PM	4:56
SB	03660	Normal	10:09 PM	0:15
EB	03660	Normal	10:24 PM	0:10
ES	03660	Normal	10:34 PM	
Punches: Mon Dec 1, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:34 PM	3:48
SB	03660	Normal	9:22 PM	0:13
EB	03660	Normal	9:35 PM	0:48
ES	03660	Normal	10:23 PM	
Punches: Tue Dec 2, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:30 PM	4:30
SB	03660	Normal	10:00 PM	0:13
EB	03660	Normal	10:13 PM	0:20
ES	03660	Normal	10:33 PM	
Punches: Fri Dec 5, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:30 PM	4:36
SB	03660	Normal	10:06 PM	0:18
EB	03660	Normal	10:24 PM	0:27
ES	03660	Normal	10:51 PM	
Punches: Sat Dec 6, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:30 PM	4:31
SB	03660	Normal	10:01 PM	0:11
EB	03660	Normal	10:12 PM	0:23
ES	03660	Normal	10:35 PM	
Punches: Sun Dec 7, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	3:52 PM	6:03
SB	03660	Normal	9:55 PM	0:12
EB	03660	Normal	10:07 PM	0:24
ES	03660	Normal	10:31 PM	
stdout
From "https://c...content-available-to-author-only...e.com/pwm/action/mobileGetTimesheetPunches"
Sun 11/2, scheduledTime, 4:37, 9:22, 9:34, 10:17, no bank run; 
Mon 11/3, scheduledTime, 5:39, 9:24, 9:34, 10:29, no bank run; 
Tue 11/4, scheduledTime, 4:50, 9:25, 9:36, 10:28, no bank run; 
Fri 11/7, scheduledTime, 5:38, 10:03, 10:14, 10:37, no bank run; 
Sat 11/8, scheduledTime, 5:32, 10:03, 10:14, 10:27, no bank run; 
Sun 11/9, scheduledTime, 4:36, 9:33, 9:45, 10:14, no bank run; 
Mon 11/10, scheduledTime, 5:27, 9:34, 9:44, 10:27, no bank run; 
Tue 11/11, scheduledTime, 5:18, 9:18, 9:35, 10:27, no bank run; 
Fri 11/14, scheduledTime, 5:31, 9:55, 10:09, 10:36, no bank run; 
Sat 11/15, scheduledTime, 5:26, 10:02, 10:20, 10:39, no bank run; 
Sun 11/16, scheduledTime, 4:44, 9:51, 10:01, 10:15, no bank run; 
Mon 11/17, scheduledTime, 5:41, 9:22, 9:32, 10:26, no bank run; 
Tue 11/18, scheduledTime, 5:17, 9:47, 10:01, 10:32, no bank run; 
Fri 11/21, scheduledTime, 5:32, 10:08, 10:18, 11:17, no bank run; 
Sat 11/22, scheduledTime, 5:26, 10:05, 10:17, 10:47, no bank run; 
Sun 11/23, scheduledTime, 3:57, 10:02, 10:13, 10:26, no bank run; 
Mon 11/24, scheduledTime, 5:36, 10:00, 10:12, 10:40, no bank run; 
Tue 11/25, scheduledTime, 4:57, 10:04, 10:15, 10:32, no bank run; 
Thu 11/27, scheduledTime, 12:18, 4:51, 5:02, 5:31, no bank run; 
Fri 11/28, scheduledTime, 5:30, 10:05, 10:23, 10:52, no bank run; 
Sat 11/29, scheduledTime, 5:19, 10:03, 10:14, 10:36, no bank run; 
Sun 11/30, scheduledTime, 5:13, 10:09, 10:24, 10:34, no bank run; 
Mon 12/1, scheduledTime, 5:34, 9:22, 9:35, 10:23, no bank run; 
Tue 12/2, scheduledTime, 5:30, 10:00, 10:13, 10:33, no bank run; 
Fri 12/5, scheduledTime, 5:30, 10:06, 10:24, 10:51, no bank run; 
Sat 12/6, scheduledTime, 5:30, 10:01, 10:12, 10:35, no bank run; 
Sun 12/7, scheduledTime, 3:52, 9:55, 10:07, 10:31, no bank run;