{"id":35080534,"url":"https://github.com/ngirard/compact-ts","last_synced_at":"2026-05-23T14:34:00.691Z","repository":{"id":302611362,"uuid":"1011388250","full_name":"ngirard/compact-ts","owner":"ngirard","description":"Command-line utility for generating and converting compact, sortable timestamps","archived":false,"fork":false,"pushed_at":"2025-09-19T12:22:39.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-05T08:41:17.297Z","etag":null,"topics":["timestamp","unique-id","unique-id-generator","unique-identifier","unique-identifiers"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ngirard.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,"zenodo":null}},"created_at":"2025-06-30T18:31:03.000Z","updated_at":"2025-11-14T09:56:57.000Z","dependencies_parsed_at":"2025-07-03T09:51:48.000Z","dependency_job_id":"4cc3b808-79f7-44fa-ad9e-c75a7e6468f4","html_url":"https://github.com/ngirard/compact-ts","commit_stats":null,"previous_names":["ngirard/compact-ts"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ngirard/compact-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngirard%2Fcompact-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngirard%2Fcompact-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngirard%2Fcompact-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngirard%2Fcompact-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngirard","download_url":"https://codeload.github.com/ngirard/compact-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngirard%2Fcompact-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33400247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"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":["timestamp","unique-id","unique-id-generator","unique-identifier","unique-identifiers"],"created_at":"2025-12-27T12:57:31.871Z","updated_at":"2026-05-23T14:34:00.686Z","avatar_url":"https://github.com/ngirard.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# compact-ts\n\nA command-line utility for generating and converting compact, sortable timestamps.\n\nThe program produces timestamps in the format `YY-DOY-BASEMIN`, which is designed to be both human-readable and easily sortable. It can also expand these timestamps back into a standard format.\n\n## Timestamp Format\n\nThe generated timestamp has the following structure: `YY-DOY-BASEMIN`\n\n* **YY**: The two-digit year (e.g., `25` for 2025).\n* **DOY**: The three-digit day of the year, zero-padded (e.g., `001`–`366`).\n* **BASEMIN**: The minutes since midnight (a value from 0 to 1439), encoded in a numerical base and zero-padded to three characters.\n    * **Default (Base-12):** Uses the characters `0-9` and `A-B`. This base is chosen for its efficient use of the 3-character space (~83.3%), where the maximum value `1439` is represented as `9BB`.\n    * **Alternative (Base-36):** Uses the characters `0-9` and `A-Z`. Provided for applications requiring a larger character set, though it is less space-efficient (maximum value `1439` is `13Z` ; space utilization is only ~3%).\n\n## Features\n\n* Generates a compact timestamp for the current time.\n* Converts standard timestamps to the compact format using the `generate --from` flag.\n* Expands a compact timestamp back into a standard, readable format using the `expand` command.\n* Parses a wide range of ISO 8601 and other common date/time formats for generation, including\n  Unix epoch seconds with fractional precision (e.g., `1757795987.58622`).\n* Offers a configurable numerical base (`--base`) for both generation and expansion.\n* Produces a fixed-width output ideal for sorting and use in filenames.\n* Compiles to a single, self-contained binary with no runtime dependencies.\n\n## Installation\n\n### From pre-compiled binaries\n\nDownload the latest binary for your operating system from the [Releases](https://github.com/ngirard/compact-ts/releases) page.\n\n### From source\n\nIf you have the Rust toolchain installed, you can install the latest version directly from the repository:\n```sh\ncargo install --git https://github.com/ngirard/compact-ts.git\n```\n\n## Usage\n\n### Generating a compact timestamp\n\nTo generate a timestamp for the current time using the default Base-12:\n```sh\n$ compact-ts\n25-181-956\n```\n\nTo generate a timestamp using Base-36:\n```sh\n$ compact-ts --base b36\n25-181-11U\n```\n\n### Converting from a standard timestamp\n\nUse the `generate --from` flag to convert a given date/time string. The parser is flexible and accepts multiple formats. The examples below assume a UTC local timezone for consistent output.\n\n```sh\n# Full ISO 8601 with timezone\n$ compact-ts generate --from \"2025-06-30T22:42:05Z\"\n25-181-956\n\n# ISO 8601 with offset, no seconds\n$ compact-ts generate --from \"2025-06-28T20:28+02:00\"\n25-179-784\n\n# Unix epoch seconds with fractional precision\n$ compact-ts generate --from 1757795987.58622\n25-256-873\n\n# Date only (time defaults to 00:00)\n$ compact-ts generate --from 2025-01-01\n25-001-000\n\n# Compact date and time to minute precision\n$ compact-ts generate --from 20250630T2242\n25-181-956\n\n# Combining flags\n$ compact-ts generate --from \"2025-06-30T22:42\" --base b36\n25-181-11U\n```\n\n### Expanding a compact timestamp\n\nUse the `expand` subcommand to convert a compact timestamp found within a string back to a standard format.\n\n```sh\n# Default expansion (assumes base-12)\n$ compact-ts expand \"backup-log-25-181-956.zip\"\n2025-06-30T22:42\n\n# Specify the base if it's not the default\n$ compact-ts expand \"archive-25-181-11U.tar.gz\" --base b36\n2025-06-30T22:42\n\n# Specify a custom output format\n$ compact-ts expand \"25-001-000\" --format \"%Y-%m-%d\"\n2025-01-01\n\n$ compact-ts expand \"25-001-000\" --format \"%A, %B %d, %Y at %I:%M %p\"\nWednesday, January 01, 2025 at 12:00 AM\n```\n\n### Help\n\nFor a full list of options, use the `--help` flag. You can also get help for a specific subcommand.\n```sh\n$ compact-ts --help\nA utility for compact, sortable timestamps.\n\nUsage: compact-ts \u003cCOMMAND\u003e\n\nCommands:\n  generate  Generate a compact timestamp (default behavior)\n  expand    Expand a compact timestamp back to a standard format\n  help      Print this message or the help of the given subcommand(s)\n\nOptions:\n  -h, --help     Print help\n  -V, --version  Print version\n\n$ compact-ts expand --help\nExpand a compact timestamp back to a standard format\n\nUsage: compact-ts expand [OPTIONS] \u003cINPUT_STRING\u003e\n\nArguments:\n  \u003cINPUT_STRING\u003e\n          The string containing the compact timestamp to expand (e.g., \"log-25-181-956.txt\")\n\nOptions:\n  -b, --base \u003cBASE\u003e\n          The numerical base to assume for the minutes component of the timestamp\n          [default: b12]\n          [possible values: b12, b36]\n  -f, --format \u003cFORMAT\u003e\n          The output format for the expanded timestamp, using chrono specifiers.\n          \n          The format cannot include seconds or sub-second precision (e.g., %S, %s, %f)\n          [default: %Y-%m-%dT%H:%M]\n  -h, --help\n          Print help\n```\n\n## Building from Source\n\n### Prerequisites\n\n* The Rust toolchain (install via [rustup.rs](https://rustup.rs/)).\n\n### Steps\n\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/ngirard/compact-ts.git\n    ```\n2. Navigate to the project directory:\n    ```sh\n    cd compact-ts\n    ```\n3. Build the release binary:\n    ```sh\n    cargo build --release\n    ```\n    The executable will be located at `./target/release/compact-ts`.\n\n4. Run tests:\n    ```sh\n    cargo test\n    ```\n\n## License\n\nThis project is licensed under the GPL-3.0 license. See the `LICENSE` file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngirard%2Fcompact-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngirard%2Fcompact-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngirard%2Fcompact-ts/lists"}