{"id":30799382,"url":"https://github.com/triole/datediff","last_synced_at":"2025-11-01T06:03:49.703Z","repository":{"id":143197941,"uuid":"550949097","full_name":"triole/datediff","owner":"triole","description":"date diff calculations for your cli","archived":false,"fork":false,"pushed_at":"2024-10-21T07:25:29.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-21T10:19:24.742Z","etag":null,"topics":["cli","datediff"],"latest_commit_sha":null,"homepage":"","language":"Go","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/triole.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":"2022-10-13T15:30:59.000Z","updated_at":"2024-10-21T07:25:33.000Z","dependencies_parsed_at":"2023-06-25T20:24:37.251Z","dependency_job_id":null,"html_url":"https://github.com/triole/datediff","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/triole/datediff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fdatediff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fdatediff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fdatediff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fdatediff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/triole","download_url":"https://codeload.github.com/triole/datediff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triole%2Fdatediff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273806206,"owners_count":25171569,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cli","datediff"],"created_at":"2025-09-05T19:11:37.797Z","updated_at":"2025-11-01T06:03:49.681Z","avatar_url":"https://github.com/triole.png","language":"Go","readme":"# Datediff ![build](https://github.com/triole/datediff/actions/workflows/build.yaml/badge.svg) ![test](https://github.com/triole/datediff/actions/workflows/test.yaml/badge.svg)\n\n\u003c!-- toc --\u003e\n\n- [Synopsis](#synopsis)\n- [Examples](#examples)\n- [Help](#help)\n\n\u003c!-- /toc --\u003e\n\n## Synopsis\n\nRunning date diff calculations in shell can be tedious. This is where this tiny tool comes in.\n\n## Examples\n\n```go mdox-exec=\"sh/dd.sh 2022-10-13T12:00:00 2022-10-15T19:00:00\"\n$ datediff 2022-10-13T12:00:00 2022-10-15T19:00:00\n\n55h0m0s\n```\n\n```go mdox-exec=\"sh/dd.sh -j 2022-10-01 2022-10-15\"\n$ datediff -j 2022-10-01 2022-10-15\n\n{\n   \"nanoseconds\": 1209600000000000,\n   \"seconds\": 1209600,\n   \"minutes\": 20160,\n   \"hours\": 336,\n   \"days\": 14,\n   \"readable\": \"336h0m0s\"\n}\n```\n\n```go mdox-exec=\"sh/dd.sh now 2022-12-31\"\n$ datediff now 2022-12-31\n\n1768h59m0.48140367s\n```\n\n```go mdox-exec=\"sh/dd.sh today tomorrow -p seconds -r 0\"\n$ datediff today tomorrow -p seconds -r 0\n\n86400\n```\n\n```go mdox-exec=\"sh/dd.sh now next_friday -p hours -r 2\"\n$ datediff now next_friday -p hours -r 2\n\n63.98\n```\n\n```go mdox-exec=\"sh/dd.sh today next_odd_monday -p hours\"\n$ datediff today next_odd_monday -p hours\n\n144\n```\n\n```go mdox-exec=\"sh/dd.sh today next_year-11-11 -p days\"\n$ datediff today next_year-11-11 -p days\n\n389.0416666666667\n```\n\n## Supported Date Layouts\n\nDatediff tries to detect the format of the input date. The following are currently supported...\n\n```go mdox-exec=\"r -l\"\n\nThe following date layouts are supported\n\n\n Format              | Layout              | Comment\n---------------------+---------------------+----------------------------------------\n YYYY-MM-DDTHH:MM:SS | 2006-01-02T15:04:05 |\n YYYY-MM-DDTHH:MM    | 2006-01-02T15:04    |\n YYYY-MM-DDTHH       | 2006-01-02T15       |\n YYYY-MM-DD          | 2006-01-02          | exact time set to 0:00:00\n MM-DD               | 01-02               | parser assumes date is in current year\n YYYYMMDD            | 20060102            |\n MMDD                | 0102                |\n```\n\n## Help\n\n```go mdox-exec=\"r -h\"\n\na command line date differ\n\nArguments:\n  [\u003cdate-1\u003e]    date1, default 'now'\n  [\u003cdate-2\u003e]    date2, default 'tomorrow'\n\nFlags:\n  -h, --help                Show context-sensitive help.\n  -p, --print=\"readable\"    print format, display diff in a specific unit,\n                            can be: nano,sec,min,hours,days\n  -r, --round=-1            round output values to precision\n  -j, --json                print full diff in json format\n  -t, --toml                print full diff as toml\n  -l, --formats             list supported date formats\n  -v, --verbose             verbose mode, default format is json, use -t to\n                            switch\n  -V, --version-flag        display version\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriole%2Fdatediff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftriole%2Fdatediff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriole%2Fdatediff/lists"}