{"id":36427064,"url":"https://github.com/asahaf/javacron","last_synced_at":"2026-01-11T18:01:24.459Z","repository":{"id":43754764,"uuid":"187722698","full_name":"asahaf/javacron","owner":"asahaf","description":"java library for parsing crontab expressions and calculating the next run time","archived":false,"fork":false,"pushed_at":"2022-02-19T17:30:06.000Z","size":61,"stargazers_count":12,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-13T10:16:21.212Z","etag":null,"topics":["cron","cron-expression","cronjob","crontab","java","parser"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asahaf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-20T22:39:03.000Z","updated_at":"2024-10-24T05:35:34.000Z","dependencies_parsed_at":"2022-08-21T20:20:23.482Z","dependency_job_id":null,"html_url":"https://github.com/asahaf/javacron","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/asahaf/javacron","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asahaf%2Fjavacron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asahaf%2Fjavacron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asahaf%2Fjavacron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asahaf%2Fjavacron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asahaf","download_url":"https://codeload.github.com/asahaf/javacron/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asahaf%2Fjavacron/sbom","scorecard":{"id":210713,"data":{"date":"2025-08-11","repo":{"name":"github.com/asahaf/javacron","commit":"2dbf4a59f0022a4f4a4262087b88f75964681049"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Code-Review","score":0,"reason":"Found 1/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":8,"reason":"2 out of the last 2 releases have a total of 2 signed artifacts.","details":["Info: signed release artifact: javacron-1.2.0-javadoc.jar.asc: https://github.com/asahaf/javacron/releases/tag/v1.2.0","Info: signed release artifact: javacron-1.1.0-javadoc.jar.asc: https://github.com/asahaf/javacron/releases/tag/v1.1.0","Warn: release artifact v1.2.0 does not have provenance: https://api.github.com/repos/asahaf/javacron/releases/17718858","Warn: release artifact v1.1.0 does not have provenance: https://api.github.com/repos/asahaf/javacron/releases/17589992"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T00:43:42.402Z","repository_id":43754764,"created_at":"2025-08-17T00:43:42.403Z","updated_at":"2025-08-17T00:43:42.403Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28316964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cron","cron-expression","cronjob","crontab","java","parser"],"created_at":"2026-01-11T18:01:07.677Z","updated_at":"2026-01-11T18:01:24.443Z","avatar_url":"https://github.com/asahaf.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/asahaf/javacron.svg?branch=master)](https://travis-ci.org/asahaf/javacron) [![Maven Central](https://img.shields.io/maven-central/v/com.asahaf.javacron/javacron.svg?label=Maven%20Central)](https://search.maven.org/artifact/com.asahaf.javacron/javacron)\n\nJavaCron\n============\n\nJavaCron is a java library which provides functionality for parsing crontab expression\nand calculating the next run, based on current or specified date time.\n\n## Features\n* Parsing crontab expression\n* Calculating next run date time, based on current or specified time\n* Calculating next run in number of milliseconds, seconds, or any specified TimeUnit\n* Support 6 fields expressions for seconds resolution\n\nNote: JavaCron doesn't provide a scheduling functionality. It only parses and calculates\nnext run(s).\n\n### 5 fields expression\n```\n┌───────────── minute (0 - 59)\n│ ┌───────────── hour (0 - 23)\n│ │ ┌───────────── day of the month (1 - 31)\n│ │ │ ┌───────────── month (1 - 12 or Jan/January - Dec/December)\n│ │ │ │ ┌───────────── day of the week (0 - 6 or Sun/Sunday - Sat/Saturday)\n│ │ │ │ │\n│ │ │ │ │\n│ │ │ │ │\n* * * * *\n```\n\n### 6 fields expression (including seconds)\n```\n┌───────────── second (0 - 59)\n│ ┌───────────── minute (0 - 59)\n│ │ ┌───────────── hour (0 - 23)\n│ │ │ ┌───────────── day of the month (1 - 31)\n│ │ │ │ ┌───────────── month (1 - 12 or Jan/January - Dec/December)\n│ │ │ │ │ ┌───────────── day of the week (0 - 6 or Sun/Sunday - Sat/Saturday)\n│ │ │ │ │ │\n│ │ │ │ │ │\n│ │ │ │ │ │\n* * * * * *\n```\n\n## Hello, world\n```java\nimport java.text.ParseException;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.concurrent.TimeUnit;\n\nimport com.asahaf.javacron.*;\n\npublic class App {\n    public static void main(String[] args) {\n        try {\n            SimpleDateFormat dateFormatter = new SimpleDateFormat(\"y-MM-dd HH:mm:ss\");\n\n            // base date 2019-01-01 04:04:02\n            Date baseDate = dateFormatter.parse(\"2019-01-01 04:04:02\");\n\n            // evey minute\n            Schedule schedule1 = Schedule.create(\"* * * * *\");\n            System.out.println(dateFormatter.format(schedule1.next(baseDate))); // 2019-01-01 04:05:00\n\n            // evey second\n            Schedule schedule2 = Schedule.create(\"* * * * * *\");\n            System.out.println(dateFormatter.format(schedule2.next(baseDate))); // 2019-01-01 04:04:03\n\n            // at hour 1, 5, and 23 every day and evey month\n            Schedule schedule3 = Schedule.create(\"0 0 1,5,23 * * *\");\n            System.out.println(dateFormatter.format(schedule3.next(baseDate))); // 2019-01-01 05:00:00\n\n            // at 00:00:00 on 29th of Feb if it's on every 4th day-of-week.\n            Schedule schedule4 = Schedule.create(\"0 0 0 29 2 */4\");\n            System.out.println(dateFormatter.format(schedule4.next(baseDate))); // 2024-02-29 00:00:00\n\n            // at 00:00:00 last Friday in Jan\n            Schedule schedule5 = Schedule.create(\"0 0 0 * * 5L\");\n            System.out.println(dateFormatter.format(schedule5.next(baseDate))); // 2019-01-25 00:00:00\n\n            // Calculating the next 5 runs\n            Date[] nextRuns = schedule3.next(baseDate, 5);\n            for (Date run : nextRuns) {\n                System.out.println(dateFormatter.format(run));\n                // 2019-01-01 05:00:00\n                // 2019-01-01 23:00:00\n                // 2019-01-02 01:00:00\n                // 2019-01-02 05:00:00\n                // 2019-01-02 23:00:00\n            }\n\n            // calculate time from base time to next run in milliseconds\n            long duration = schedule3.nextDuration(baseDate, TimeUnit.MILLISECONDS);\n            System.out.println(String.format(\"next run is after %d milliseconds\", duration));\n            // next run is after 3358000 milliseconds\n\n            /*\n             * next and nextDuration can be called without specifying a base date. when base\n             * date is not specified, the current date will be used e.g. schedule.next()\n             * schedule.next(5) schedule.nextDuration()\n             */\n\n        } catch (InvalidExpressionException ex) {\n            System.out.println(ex);\n        } catch (ParseException ex) {\n            System.out.println(ex);\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasahaf%2Fjavacron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasahaf%2Fjavacron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasahaf%2Fjavacron/lists"}