{"id":19131168,"url":"https://github.com/pjsalter/java-timetraveler-toolkit","last_synced_at":"2026-05-19T14:31:49.322Z","repository":{"id":202630463,"uuid":"707758156","full_name":"PJSalter/Java-TimeTraveler-Toolkit","owner":"PJSalter","description":"⏰ Java TimeTraveler Toolkit 📆 provides essential date and time calculation functions to effortlessly navigate the temporal landscape using Java's Date/Time API.","archived":false,"fork":false,"pushed_at":"2023-10-20T17:04:22.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-03T11:22:08.437Z","etag":null,"topics":["java","java20","junit5","jupiter","maven"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PJSalter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-20T15:34:56.000Z","updated_at":"2023-10-20T17:11:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ab2e03e-ad6b-4bef-8ca9-9924a078afa0","html_url":"https://github.com/PJSalter/Java-TimeTraveler-Toolkit","commit_stats":null,"previous_names":["pjsalter/java-timetraveler-toolkit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FJava-TimeTraveler-Toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FJava-TimeTraveler-Toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FJava-TimeTraveler-Toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PJSalter%2FJava-TimeTraveler-Toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PJSalter","download_url":"https://codeload.github.com/PJSalter/Java-TimeTraveler-Toolkit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240206995,"owners_count":19765041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","java20","junit5","jupiter","maven"],"created_at":"2024-11-09T06:14:22.592Z","updated_at":"2025-10-03T16:19:08.795Z","avatar_url":"https://github.com/PJSalter.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⏰ Java TimeTraveler Toolkit 📆\n\nThis Java project provides a set of functions for performing various date and time calculations using the Java Date/Time API. These functions include:\n\n- `getTodaysDate()`: Returns today's date.\n- `getLaterDatebyDays(LocalDate date, int x)`: Returns the date corresponding to x days after the input date.\n- `getPreviousDatebyWeeks(LocalDate date, int x)`: Returns the date corresponding to x weeks before the input date.\n- `getTimeDifference(LocalDate date1, LocalDate date2)`: Returns the time difference between two input dates in years, months, and days in the format \"Year-20:Months-5:Days-1\".\n\n## Usage\nYou can use these date and time functions in your Java projects as follows:\n\n```java\npackage com.company;\n\nimport java.time.LocalDate;\n\npublic class JavaTimeTravelerToolkit {\n    public static void main(String[] args) {\n       // Print today's date\n       System.out.println(\"Today's date is: \" + getTodaysDate());\n\n       // Print the date 14 days from today\n       System.out.println(\"14 days from today is: \" + getLaterDatebyDays(getTodaysDate(), 14));\n\n        // Print the date 5 weeks before today\n        System.out.println(\"5 weeks prior to today was: \" + getPreviousDatebyWeeks(getTodaysDate(), 5));\n\n        // Calculate and print the time difference between today and June 30, 2031\n        System.out.println(\"The difference between today and June 30, 2031 is: \" +\n        getTimeDifference(getTodaysDate(), LocalDate.of(2031, 06, 30)));\n    }\n}\n```\n\n## 🧪 Testing\nThis project includes JUnit 5 tests to ensure the correctness of the date and time functions. You can run the tests using your preferred IDE or build tool.\n\n```java\n// One of my Tests to check if function returns today's date.\n@TestInstance(TestInstance.Lifecycle.PER_CLASS)\n@DisplayName(\"Java Time Traveler Toolkit functionality for Date and Time\")\nclass JavaTimeTravelerToolkitTest {\n    @org.junit.jupiter.api.Test\n    @DisplayName(\"Positive Test case - Check whether function returns today's date successfully\")\n    public void getTodaysDate() {\n        LocalDate expected = LocalDate.now();\n        LocalDate actual = JavaTimeTravelerToolkit.getTodaysDate();\n        Assertions.assertEquals(expected, actual);\n    }\n}\n```\n\n## Authored by: [Peter James Salter](https://github.com/PJSalter)\n\n## ✨Happy Coding 🚀","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjsalter%2Fjava-timetraveler-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjsalter%2Fjava-timetraveler-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjsalter%2Fjava-timetraveler-toolkit/lists"}