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.42s 59068KB
stdin
Punches: Fri Oct 31, 2025
SS	Normal	5:30 PM	5:34 PM	5:34 PM	4:14	
SB	Normal		9:48 PM	9:48 PM	0:13	
EB	Normal		10:01 PM	10:01 PM	0:34	
ES	Normal	10:30 PM	10:35 PM	10:35 PM			
Punches: Sat Nov 1, 2025
SS	Normal	5:30 PM	5:35 PM	5:35 PM	4:17	
SB	Normal		9:52 PM	9:52 PM	0:13	
EB	Normal		10:05 PM	10:05 PM	0:23	
ES	Normal	10:30 PM	10:28 PM	10:28 PM			
Punches: Sun Nov 2, 2025
SS	Normal	5:30 PM	4:37 PM	4:37 PM	4:45	
SB	Normal		9:22 PM	9:22 PM	0:12	
EB	Normal		9:34 PM	9:34 PM	0:43	
ES	Normal	10:30 PM	10:17 PM	10:17 PM			

Punches: Mon Dec 29, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:28 PM	3:56
SB	03660	Normal	9:24 PM	0:13
EB	03660	Normal	9:37 PM	0:42
ES	03660	Normal	10:19 PM	
Punches: Tue Dec 30, 2025
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:31 PM	3:47
SB	03660	Normal	9:18 PM	0:17
EB	03660	Normal	9:35 PM	0:45
ES	03660	Normal	10:20 PM	
Punches: Fri Jan 2, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:35 PM	4:14
SB	03660	Normal	9:49 PM	0:13
EB	03660	Normal	10:02 PM	0:34
ES	03660	Normal	10:36 PM	
Punches: Sat Jan 3, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:37 PM	4:13
SB	03660	Normal	9:50 PM	0:15
EB	03660	Normal	10:05 PM	0:32
ES	03660	Normal	10:37 PM	

Punches: Sun Jan 4, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:34 PM	3:42
SB	03660	Normal	9:16 PM	0:15
EB	03660	Normal	9:31 PM	0:41
ES	03660	Normal	10:12 PM	
Punches: Mon Jan 5, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:36 PM	3:23
SB	03660	Normal	8:59 PM	0:13
EB	03660	Normal	9:12 PM	1:08
ES	03660	Normal	10:20 PM	
Punches: Thu Jan 8, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:38 PM	4:10
SB	03660	Normal	9:48 PM	0:11
EB	03660	Normal	9:59 PM	0:31
ES	03660	Normal	10:30 PM	
Punches: Fri Jan 9, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:32 PM	4:26
SB	03660	Normal	9:58 PM	0:13
EB	03660	Normal	10:11 PM	0:21
ES	03660	Normal	10:32 PM	
Punches: Sat Jan 10, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:25 PM	4:30
SB	03660	Normal	9:55 PM	0:17
EB	03660	Normal	10:12 PM	0:18
ES	03660	Normal	10:30 PM	

Punches: Sun Jan 11, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:29 PM	3:53
SB	03660	Normal	9:22 PM	0:13
EB	03660	Normal	9:35 PM	0:46
ES	03660	Normal	10:21 PM	
Punches: Mon Jan 12, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:35 PM	3:44
SB	03660	Normal	9:19 PM	0:11
EB	03660	Normal	9:30 PM	0:45
ES	03660	Normal	10:15 PM	
Punches: Tue Jan 13, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:33 PM	4:30
SB	03660	Normal	10:03 PM	0:10
EB	03660	Added	10:13 PM	0:25
ES	03660	Normal	10:38 PM	
Punches: Fri Jan 16, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:14 PM	4:53
SB	03660	Normal	10:07 PM	0:11
EB	03660	Normal	10:18 PM	0:22
ES	03660	Normal	10:40 PM	
Punches: Sat Jan 17, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:23 PM	4:42
SB	03660	Normal	10:05 PM	0:10
EB	03660	Normal	10:15 PM	0:19
ES	03660	Normal	10:34 PM	
Punches: Sun Jan 18, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:31 PM	4:11
SB	03660	Normal	9:42 PM	0:12
EB	03660	Normal	9:54 PM	0:40
ES	03660	Normal	10:34 PM	
Punches: Mon Jan 19, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:26 PM	3:51
SB	03660	Added	9:17 PM	0:10
EB	03660	Normal	9:27 PM	0:51
ES	03660	Normal	10:18 PM	
Punches: Wed Jan 21, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:36 PM	4:19
SB	03660	Normal	9:55 PM	0:11
EB	03660	Normal	10:06 PM	1:00
ES	03660	Normal	11:06 PM	
Punches: Fri Jan 23, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:29 PM	3:46
SB	03660	Normal	9:15 PM	0:16
EB	03660	Normal	9:31 PM	0:51
ES	03660	Normal	10:22 PM	
Punches: Sat Jan 24, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:28 PM	3:50
SB	03660	Normal	9:18 PM	0:13
EB	03660	Normal	9:31 PM	1:04
ES	03660	Normal	10:35 PM	

Punches: Sun Jan 25, 2026
Type	Store	Status	Time	Hrs
SS	03660	Added	5:30 PM	4:50
ES	03660	Added	10:20 PM	
Punches: Mon Jan 26, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:43 PM	3:33
SB	03660	Normal	9:16 PM	0:12
EB	03660	Normal	9:28 PM	0:47
ES	03660	Normal	10:15 PM	
Punches: Wed Jan 28, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:34 PM	3:55
SB	03660	Normal	9:29 PM	0:12
EB	03660	Normal	9:41 PM	0:49
ES	03660	Normal	10:30 PM	
Punches: Thu Jan 29, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:34 PM	3:57
SB	03660	Normal	9:31 PM	0:12
EB	03660	Normal	9:43 PM	0:32
ES	03660	Normal	10:15 PM	
Punches: Sat Jan 31, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:28 PM	4:02
SB	03660	Normal	9:30 PM	0:14
EB	03660	Normal	9:44 PM	0:51
ES	03660	Normal	10:35 PM	

Punches: Sun Feb 1, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:31 PM	3:40
SB	03660	Normal	9:11 PM	0:15
EB	03660	Normal	9:26 PM	0:51
ES	03660	Normal	10:17 PM	
Punches: Mon Feb 2, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:27 PM	3:47
SB	03660	Normal	9:14 PM	0:14
EB	03660	Normal	9:28 PM	0:51
ES	03660	Normal	10:19 PM	
Punches: Tue Feb 3, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:33 PM	4:39
SB	03660	Normal	10:12 PM	0:11
EB	03660	Normal	10:23 PM	0:19
ES	03660	Normal	10:42 PM	
Punches: Wed Feb 4, 2026
Type	Store	Status	Time	Hrs
SS	03660	Normal	5:32 PM	5:04
ES	03660	Normal	10:36 PM	
stdout
From "https://c...content-available-to-author-only...e.com/pwm/action/mobileGetTimesheetPunches"
Fri 10/31, scheduledTime, 5:34, 9:48, 10:01, 10:35, no bank run; 
Sat 11/1, scheduledTime, 5:35, 9:52, 10:05, 10:28, no bank run; 
Sun 11/2, scheduledTime, 4:37, 9:22, 9:34, 10:17, no bank run; 
Mon 12/29, scheduledTime, 5:28, 9:24, 9:37, 10:19, no bank run; 
Tue 12/30, scheduledTime, 5:31, 9:18, 9:35, 10:20, no bank run; 
Fri 01/2, scheduledTime, 5:35, 9:49, 10:02, 10:36, no bank run; 
Sat 01/3, scheduledTime, 5:37, 9:50, 10:05, 10:37, no bank run; 
Sun 01/4, scheduledTime, 5:34, 9:16, 9:31, 10:12, no bank run; 
Mon 01/5, scheduledTime, 5:36, 8:59, 9:12, 10:20, no bank run; 
Thu 01/8, scheduledTime, 5:38, 9:48, 9:59, 10:30, no bank run; 
Fri 01/9, scheduledTime, 5:32, 9:58, 10:11, 10:32, no bank run; 
Sat 01/10, scheduledTime, 5:25, 9:55, 10:12, 10:30, no bank run; 
Sun 01/11, scheduledTime, 5:29, 9:22, 9:35, 10:21, no bank run; 
Mon 01/12, scheduledTime, 5:35, 9:19, 9:30, 10:15, no bank run; 
Tue 01/13, scheduledTime, 5:33, 10:03, 10:13, 10:38, no bank run; 
Fri 01/16, scheduledTime, 5:14, 10:07, 10:18, 10:40, no bank run; 
Sat 01/17, scheduledTime, 5:23, 10:05, 10:15, 10:34, no bank run; 
Sun 01/18, scheduledTime, 5:31, 9:42, 9:54, 10:34, no bank run; 
Mon 01/19, scheduledTime, 5:26, 9:17, 9:27, 10:18, no bank run; 
Wed 01/21, scheduledTime, 5:36, 9:55, 10:06, 11:06, no bank run; 
Fri 01/23, scheduledTime, 5:29, 9:15, 9:31, 10:22, no bank run; 
Sat 01/24, scheduledTime, 5:28, 9:18, 9:31, 10:35, no bank run; 
Sun 01/25, scheduledTime, 5:30, 10:20, no bank run; 
Mon 01/26, scheduledTime, 5:43, 9:16, 9:28, 10:15, no bank run; 
Wed 01/28, scheduledTime, 5:34, 9:29, 9:41, 10:30, no bank run; 
Thu 01/29, scheduledTime, 5:34, 9:31, 9:43, 10:15, no bank run; 
Sat 01/31, scheduledTime, 5:28, 9:30, 9:44, 10:35, no bank run; 
Sun 02/1, scheduledTime, 5:31, 9:11, 9:26, 10:17, no bank run; 
Mon 02/2, scheduledTime, 5:27, 9:14, 9:28, 10:19, no bank run; 
Tue 02/3, scheduledTime, 5:33, 10:12, 10:23, 10:42, no bank run; 
Wed 02/4, scheduledTime, 5:32, 10:36, no bank run;