{"id":26343888,"url":"https://github.com/sbarbett/quicktime","last_synced_at":"2025-09-11T01:05:38.180Z","repository":{"id":282062103,"uuid":"947362467","full_name":"sbarbett/quicktime","owner":"sbarbett","description":"Small shell script for creating ISO 8601 timestamps","archived":false,"fork":false,"pushed_at":"2025-03-12T15:14:16.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-12T16:26:19.278Z","etag":null,"topics":["shell","sysadmin-tool"],"latest_commit_sha":null,"homepage":"https://shane.barbetta.me","language":"Shell","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/sbarbett.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-03-12T15:12:02.000Z","updated_at":"2025-03-12T15:14:21.000Z","dependencies_parsed_at":"2025-03-12T22:30:58.339Z","dependency_job_id":null,"html_url":"https://github.com/sbarbett/quicktime","commit_stats":null,"previous_names":["sbarbett/quicktime"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbarbett%2Fquicktime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbarbett%2Fquicktime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbarbett%2Fquicktime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbarbett%2Fquicktime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbarbett","download_url":"https://codeload.github.com/sbarbett/quicktime/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243827477,"owners_count":20354317,"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":["shell","sysadmin-tool"],"created_at":"2025-03-16T05:19:29.085Z","updated_at":"2025-03-16T05:19:29.658Z","avatar_url":"https://github.com/sbarbett.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⏳ quicktime\n\nNot the video player. This is a simple shell script for quickly generating datetime ranges in ISO 8601 format. It works in both BSD-derived shell environments (macOS) and Linux.\n\n## Overview\n\nQuicktime generates start and end timestamps for various time intervals:\n- The last hour\n- The last day (24 hours)\n- The last week (7 days)\n- The last month (30 days)\n\nIt can also generate timestamps for calendar-based intervals:\n- The previous hour (e.g., 10:00:00 to 10:59:59)\n- The previous calendar day (yesterday, from 00:00:00 to 23:59:59)\n- The previous calendar week (previous Monday through Sunday)\n- The previous calendar month (e.g., February 1st 00:00:00 to February 28th 23:59:59)\n\n## Installation\n\n1. Download the script:\n   ```bash\n   curl -O https://raw.githubusercontent.com/sbarbett/quicktime/main/quicktime.sh\n   ```\n\n2. Make it executable:\n   ```bash\n   chmod +x quicktime.sh\n   ```\n\n3. Optionally, symbolically link it to your PATH:\n   ```bash\n   ln -s \"$(pwd)/quicktime.sh\" /usr/local/bin/quicktime\n   ```\n\n## Usage\n\n```\nquicktime [hour|day|week|month] [--calendar] [--format FORMAT] [--utc]\n```\n\n### Arguments\n\n- `hour|day|week|month`: Required. Specifies the time interval to generate.\n- `--calendar`: Optional. Use calendar-based intervals instead of relative time.\n- `--format FORMAT`: Optional. Specify a custom output format (default: \"yyyy-MM-dd HH:mm:ss\").\n- `--utc`: Optional. Use UTC time instead of local time.\n\n### Format Specifiers\n\n- `yyyy`: 4-digit year\n- `MM`: 2-digit month (01-12)\n- `dd`: 2-digit day (01-31)\n- `hh` or `HH`: 2-digit hour (00-23)\n- `mm`: 2-digit minute (00-59)\n- `ss`: 2-digit second (00-59)\n- `SSS`: 3-digit millisecond (000-999)\n\n## Examples\n\n### Relative Time Intervals\n\n```bash\n# Last hour\n$ quicktime hour\n{\n  \"start\": \"2025-03-12 13:01:41\",\n  \"end\": \"2025-03-12 14:01:41\"\n}\n\n# Last day (24 hours)\n$ quicktime day\n{\n  \"start\": \"2025-03-11 14:01:41\",\n  \"end\": \"2025-03-12 14:01:41\"\n}\n\n# Last week (7 days)\n$ quicktime week\n{\n  \"start\": \"2025-03-05 14:01:41\",\n  \"end\": \"2025-03-12 14:01:41\"\n}\n\n# Last month (30 days)\n$ quicktime month\n{\n  \"start\": \"2025-02-10 14:01:41\",\n  \"end\": \"2025-03-12 14:01:41\"\n}\n```\n\n### Calendar-Based Intervals\n\n```bash\n# Previous hour\n$ quicktime hour --calendar\n{\n  \"start\": \"2025-03-12 13:00:00\",\n  \"end\": \"2025-03-12 13:59:59\"\n}\n\n# Previous day (yesterday)\n$ quicktime day --calendar\n{\n  \"start\": \"2025-03-11 00:00:00\",\n  \"end\": \"2025-03-11 23:59:59\"\n}\n\n# Previous calendar week (Monday-Sunday)\n$ quicktime week --calendar\n{\n  \"start\": \"2025-03-03 00:00:00\",\n  \"end\": \"2025-03-09 23:59:59\"\n}\n\n# Previous calendar month\n$ quicktime month --calendar\n{\n  \"start\": \"2025-02-01 00:00:00\",\n  \"end\": \"2025-02-28 23:59:59\"\n}\n```\n\n### Custom Format\n\n```bash\n# Date only format\n$ quicktime day --format \"yyyy-MM-dd\"\n{\n  \"start\": \"2025-03-11\",\n  \"end\": \"2025-03-12\"\n}\n\n# With milliseconds\n$ quicktime hour --calendar --format \"yyyy-MM-dd HH:mm:ss.SSS\"\n{\n  \"start\": \"2025-03-12 13:00:00.000\",\n  \"end\": \"2025-03-12 13:59:59.999\"\n}\n```\n\n### UTC Time\n\n```bash\n$ quicktime day --utc\n{\n  \"start\": \"2025-03-11 14:01:41\",\n  \"end\": \"2025-03-12 14:01:41\"\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbarbett%2Fquicktime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbarbett%2Fquicktime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbarbett%2Fquicktime/lists"}