├── .github ├── dependabot.yml └── workflows │ └── rust.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── Makefile ├── README.md ├── image └── txt_icon.jpg └── src ├── command.rs ├── command ├── arguments.rs ├── arguments │ ├── ambiguous_time_strategy.rs │ ├── from.rs │ ├── time.rs │ └── to.rs ├── command_definition.rs ├── receiver.rs ├── validated_options.rs └── validated_options │ ├── ambiguous_time_strategy.rs │ └── validated_user_inputs.rs ├── infrastructure.rs ├── infrastructure ├── current_local_timezone_provider.rs └── current_local_timezone_provider │ ├── get_system_timezone_from_env_var_tz.rs │ ├── get_system_timezone_from_etc_localtime.rs │ ├── get_system_timezone_from_etc_timezone.rs │ └── local_timezone_string_provider.rs ├── main.rs ├── translator.rs ├── translator └── translation_error.rs ├── validator.rs └── validator ├── ambiguous_time_strategy_validator.rs ├── command_options_validator.rs ├── native_datetime_validator.rs ├── regex_matcher.rs ├── regex_matcher ├── ymd_hms_matcher.rs ├── ymd_matcher.rs └── ymd_t_hms_matcher.rs ├── timezone_validator.rs └── validation_error.rs /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "cargo" 4 | directory: "/" 5 | schedule: 6 | interval: "monthly" 7 | -------------------------------------------------------------------------------- /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Build and Test 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ${{ matrix.os }} 16 | 17 | strategy: 18 | matrix: 19 | os: [ubuntu-latest, macos-latest] 20 | 21 | steps: 22 | - uses: actions/checkout@v4 23 | - name: Build 24 | run: cargo build --verbose 25 | - name: Check 26 | run: cargo check --verbose 27 | - name: Clippy 28 | run: cargo clippy --verbose 29 | - name: Run tests 30 | run: cargo test --verbose 31 | # TODO: Add show modules if GitHub Actions supports it 32 | # - name: Show Modules 33 | # run: cargo modules structure 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .idea 3 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "aho-corasick" 7 | version = "1.1.3" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 10 | dependencies = [ 11 | "memchr", 12 | ] 13 | 14 | [[package]] 15 | name = "android-tzdata" 16 | version = "0.1.1" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 19 | 20 | [[package]] 21 | name = "android_system_properties" 22 | version = "0.1.5" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 25 | dependencies = [ 26 | "libc", 27 | ] 28 | 29 | [[package]] 30 | name = "anstream" 31 | version = "0.6.14" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" 34 | dependencies = [ 35 | "anstyle", 36 | "anstyle-parse", 37 | "anstyle-query", 38 | "anstyle-wincon", 39 | "colorchoice", 40 | "is_terminal_polyfill", 41 | "utf8parse", 42 | ] 43 | 44 | [[package]] 45 | name = "anstyle" 46 | version = "1.0.8" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" 49 | 50 | [[package]] 51 | name = "anstyle-parse" 52 | version = "0.2.4" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" 55 | dependencies = [ 56 | "utf8parse", 57 | ] 58 | 59 | [[package]] 60 | name = "anstyle-query" 61 | version = "1.1.0" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" 64 | dependencies = [ 65 | "windows-sys", 66 | ] 67 | 68 | [[package]] 69 | name = "anstyle-wincon" 70 | version = "3.0.3" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" 73 | dependencies = [ 74 | "anstyle", 75 | "windows-sys", 76 | ] 77 | 78 | [[package]] 79 | name = "assert_cmd" 80 | version = "2.0.17" 81 | source = "registry+https://github.com/rust-lang/crates.io-index" 82 | checksum = "2bd389a4b2970a01282ee455294913c0a43724daedcd1a24c3eb0ec1c1320b66" 83 | dependencies = [ 84 | "anstyle", 85 | "bstr", 86 | "doc-comment", 87 | "libc", 88 | "predicates", 89 | "predicates-core", 90 | "predicates-tree", 91 | "wait-timeout", 92 | ] 93 | 94 | [[package]] 95 | name = "autocfg" 96 | version = "1.3.0" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" 99 | 100 | [[package]] 101 | name = "bstr" 102 | version = "1.10.0" 103 | source = "registry+https://github.com/rust-lang/crates.io-index" 104 | checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" 105 | dependencies = [ 106 | "memchr", 107 | "regex-automata", 108 | "serde", 109 | ] 110 | 111 | [[package]] 112 | name = "bumpalo" 113 | version = "3.16.0" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 116 | 117 | [[package]] 118 | name = "cc" 119 | version = "1.0.99" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" 122 | 123 | [[package]] 124 | name = "cfg-if" 125 | version = "1.0.0" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 128 | 129 | [[package]] 130 | name = "chrono" 131 | version = "0.4.41" 132 | source = "registry+https://github.com/rust-lang/crates.io-index" 133 | checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" 134 | dependencies = [ 135 | "android-tzdata", 136 | "iana-time-zone", 137 | "js-sys", 138 | "num-traits", 139 | "wasm-bindgen", 140 | "windows-link", 141 | ] 142 | 143 | [[package]] 144 | name = "chrono-tz" 145 | version = "0.10.3" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "efdce149c370f133a071ca8ef6ea340b7b88748ab0810097a9e2976eaa34b4f3" 148 | dependencies = [ 149 | "chrono", 150 | "chrono-tz-build", 151 | "phf", 152 | ] 153 | 154 | [[package]] 155 | name = "chrono-tz-build" 156 | version = "0.4.0" 157 | source = "registry+https://github.com/rust-lang/crates.io-index" 158 | checksum = "e94fea34d77a245229e7746bd2beb786cd2a896f306ff491fb8cecb3074b10a7" 159 | dependencies = [ 160 | "parse-zoneinfo", 161 | "phf_codegen", 162 | ] 163 | 164 | [[package]] 165 | name = "clap" 166 | version = "4.5.37" 167 | source = "registry+https://github.com/rust-lang/crates.io-index" 168 | checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" 169 | dependencies = [ 170 | "clap_builder", 171 | ] 172 | 173 | [[package]] 174 | name = "clap_builder" 175 | version = "4.5.37" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" 178 | dependencies = [ 179 | "anstream", 180 | "anstyle", 181 | "clap_lex", 182 | "strsim", 183 | ] 184 | 185 | [[package]] 186 | name = "clap_lex" 187 | version = "0.7.4" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" 190 | 191 | [[package]] 192 | name = "colorchoice" 193 | version = "1.0.1" 194 | source = "registry+https://github.com/rust-lang/crates.io-index" 195 | checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" 196 | 197 | [[package]] 198 | name = "core-foundation-sys" 199 | version = "0.8.6" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" 202 | 203 | [[package]] 204 | name = "difflib" 205 | version = "0.4.0" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" 208 | 209 | [[package]] 210 | name = "doc-comment" 211 | version = "0.3.3" 212 | source = "registry+https://github.com/rust-lang/crates.io-index" 213 | checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" 214 | 215 | [[package]] 216 | name = "float-cmp" 217 | version = "0.10.0" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" 220 | dependencies = [ 221 | "num-traits", 222 | ] 223 | 224 | [[package]] 225 | name = "iana-time-zone" 226 | version = "0.1.60" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" 229 | dependencies = [ 230 | "android_system_properties", 231 | "core-foundation-sys", 232 | "iana-time-zone-haiku", 233 | "js-sys", 234 | "wasm-bindgen", 235 | "windows-core", 236 | ] 237 | 238 | [[package]] 239 | name = "iana-time-zone-haiku" 240 | version = "0.1.2" 241 | source = "registry+https://github.com/rust-lang/crates.io-index" 242 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 243 | dependencies = [ 244 | "cc", 245 | ] 246 | 247 | [[package]] 248 | name = "is_terminal_polyfill" 249 | version = "1.70.0" 250 | source = "registry+https://github.com/rust-lang/crates.io-index" 251 | checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" 252 | 253 | [[package]] 254 | name = "js-sys" 255 | version = "0.3.69" 256 | source = "registry+https://github.com/rust-lang/crates.io-index" 257 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" 258 | dependencies = [ 259 | "wasm-bindgen", 260 | ] 261 | 262 | [[package]] 263 | name = "libc" 264 | version = "0.2.155" 265 | source = "registry+https://github.com/rust-lang/crates.io-index" 266 | checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" 267 | 268 | [[package]] 269 | name = "log" 270 | version = "0.4.21" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 273 | 274 | [[package]] 275 | name = "memchr" 276 | version = "2.7.2" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" 279 | 280 | [[package]] 281 | name = "normalize-line-endings" 282 | version = "0.3.0" 283 | source = "registry+https://github.com/rust-lang/crates.io-index" 284 | checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" 285 | 286 | [[package]] 287 | name = "num-traits" 288 | version = "0.2.19" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 291 | dependencies = [ 292 | "autocfg", 293 | ] 294 | 295 | [[package]] 296 | name = "once_cell" 297 | version = "1.19.0" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 300 | 301 | [[package]] 302 | name = "parse-zoneinfo" 303 | version = "0.3.1" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" 306 | dependencies = [ 307 | "regex", 308 | ] 309 | 310 | [[package]] 311 | name = "phf" 312 | version = "0.11.2" 313 | source = "registry+https://github.com/rust-lang/crates.io-index" 314 | checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" 315 | dependencies = [ 316 | "phf_shared", 317 | ] 318 | 319 | [[package]] 320 | name = "phf_codegen" 321 | version = "0.11.2" 322 | source = "registry+https://github.com/rust-lang/crates.io-index" 323 | checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" 324 | dependencies = [ 325 | "phf_generator", 326 | "phf_shared", 327 | ] 328 | 329 | [[package]] 330 | name = "phf_generator" 331 | version = "0.11.2" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" 334 | dependencies = [ 335 | "phf_shared", 336 | "rand", 337 | ] 338 | 339 | [[package]] 340 | name = "phf_shared" 341 | version = "0.11.2" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" 344 | dependencies = [ 345 | "siphasher", 346 | ] 347 | 348 | [[package]] 349 | name = "predicates" 350 | version = "3.1.3" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" 353 | dependencies = [ 354 | "anstyle", 355 | "difflib", 356 | "float-cmp", 357 | "normalize-line-endings", 358 | "predicates-core", 359 | "regex", 360 | ] 361 | 362 | [[package]] 363 | name = "predicates-core" 364 | version = "1.0.8" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | checksum = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931" 367 | 368 | [[package]] 369 | name = "predicates-tree" 370 | version = "1.0.11" 371 | source = "registry+https://github.com/rust-lang/crates.io-index" 372 | checksum = "41b740d195ed3166cd147c8047ec98db0e22ec019eb8eeb76d343b795304fb13" 373 | dependencies = [ 374 | "predicates-core", 375 | "termtree", 376 | ] 377 | 378 | [[package]] 379 | name = "proc-macro2" 380 | version = "1.0.85" 381 | source = "registry+https://github.com/rust-lang/crates.io-index" 382 | checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" 383 | dependencies = [ 384 | "unicode-ident", 385 | ] 386 | 387 | [[package]] 388 | name = "quote" 389 | version = "1.0.36" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" 392 | dependencies = [ 393 | "proc-macro2", 394 | ] 395 | 396 | [[package]] 397 | name = "rand" 398 | version = "0.8.5" 399 | source = "registry+https://github.com/rust-lang/crates.io-index" 400 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 401 | dependencies = [ 402 | "rand_core", 403 | ] 404 | 405 | [[package]] 406 | name = "rand_core" 407 | version = "0.6.4" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 410 | 411 | [[package]] 412 | name = "regex" 413 | version = "1.11.1" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" 416 | dependencies = [ 417 | "aho-corasick", 418 | "memchr", 419 | "regex-automata", 420 | "regex-syntax", 421 | ] 422 | 423 | [[package]] 424 | name = "regex-automata" 425 | version = "0.4.8" 426 | source = "registry+https://github.com/rust-lang/crates.io-index" 427 | checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" 428 | dependencies = [ 429 | "aho-corasick", 430 | "memchr", 431 | "regex-syntax", 432 | ] 433 | 434 | [[package]] 435 | name = "regex-syntax" 436 | version = "0.8.5" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" 439 | 440 | [[package]] 441 | name = "serde" 442 | version = "1.0.204" 443 | source = "registry+https://github.com/rust-lang/crates.io-index" 444 | checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" 445 | dependencies = [ 446 | "serde_derive", 447 | ] 448 | 449 | [[package]] 450 | name = "serde_derive" 451 | version = "1.0.204" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" 454 | dependencies = [ 455 | "proc-macro2", 456 | "quote", 457 | "syn", 458 | ] 459 | 460 | [[package]] 461 | name = "siphasher" 462 | version = "0.3.11" 463 | source = "registry+https://github.com/rust-lang/crates.io-index" 464 | checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" 465 | 466 | [[package]] 467 | name = "strsim" 468 | version = "0.11.1" 469 | source = "registry+https://github.com/rust-lang/crates.io-index" 470 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 471 | 472 | [[package]] 473 | name = "syn" 474 | version = "2.0.87" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" 477 | dependencies = [ 478 | "proc-macro2", 479 | "quote", 480 | "unicode-ident", 481 | ] 482 | 483 | [[package]] 484 | name = "termtree" 485 | version = "0.4.1" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" 488 | 489 | [[package]] 490 | name = "thiserror" 491 | version = "2.0.12" 492 | source = "registry+https://github.com/rust-lang/crates.io-index" 493 | checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" 494 | dependencies = [ 495 | "thiserror-impl", 496 | ] 497 | 498 | [[package]] 499 | name = "thiserror-impl" 500 | version = "2.0.12" 501 | source = "registry+https://github.com/rust-lang/crates.io-index" 502 | checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" 503 | dependencies = [ 504 | "proc-macro2", 505 | "quote", 506 | "syn", 507 | ] 508 | 509 | [[package]] 510 | name = "tzt" 511 | version = "0.3.1" 512 | dependencies = [ 513 | "assert_cmd", 514 | "chrono", 515 | "chrono-tz", 516 | "clap", 517 | "predicates", 518 | "regex", 519 | "thiserror", 520 | ] 521 | 522 | [[package]] 523 | name = "unicode-ident" 524 | version = "1.0.12" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 527 | 528 | [[package]] 529 | name = "utf8parse" 530 | version = "0.2.2" 531 | source = "registry+https://github.com/rust-lang/crates.io-index" 532 | checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 533 | 534 | [[package]] 535 | name = "wait-timeout" 536 | version = "0.2.0" 537 | source = "registry+https://github.com/rust-lang/crates.io-index" 538 | checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" 539 | dependencies = [ 540 | "libc", 541 | ] 542 | 543 | [[package]] 544 | name = "wasm-bindgen" 545 | version = "0.2.92" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 548 | dependencies = [ 549 | "cfg-if", 550 | "wasm-bindgen-macro", 551 | ] 552 | 553 | [[package]] 554 | name = "wasm-bindgen-backend" 555 | version = "0.2.92" 556 | source = "registry+https://github.com/rust-lang/crates.io-index" 557 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 558 | dependencies = [ 559 | "bumpalo", 560 | "log", 561 | "once_cell", 562 | "proc-macro2", 563 | "quote", 564 | "syn", 565 | "wasm-bindgen-shared", 566 | ] 567 | 568 | [[package]] 569 | name = "wasm-bindgen-macro" 570 | version = "0.2.92" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 573 | dependencies = [ 574 | "quote", 575 | "wasm-bindgen-macro-support", 576 | ] 577 | 578 | [[package]] 579 | name = "wasm-bindgen-macro-support" 580 | version = "0.2.92" 581 | source = "registry+https://github.com/rust-lang/crates.io-index" 582 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 583 | dependencies = [ 584 | "proc-macro2", 585 | "quote", 586 | "syn", 587 | "wasm-bindgen-backend", 588 | "wasm-bindgen-shared", 589 | ] 590 | 591 | [[package]] 592 | name = "wasm-bindgen-shared" 593 | version = "0.2.92" 594 | source = "registry+https://github.com/rust-lang/crates.io-index" 595 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 596 | 597 | [[package]] 598 | name = "windows-core" 599 | version = "0.52.0" 600 | source = "registry+https://github.com/rust-lang/crates.io-index" 601 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 602 | dependencies = [ 603 | "windows-targets", 604 | ] 605 | 606 | [[package]] 607 | name = "windows-link" 608 | version = "0.1.0" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" 611 | 612 | [[package]] 613 | name = "windows-sys" 614 | version = "0.52.0" 615 | source = "registry+https://github.com/rust-lang/crates.io-index" 616 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 617 | dependencies = [ 618 | "windows-targets", 619 | ] 620 | 621 | [[package]] 622 | name = "windows-targets" 623 | version = "0.52.5" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" 626 | dependencies = [ 627 | "windows_aarch64_gnullvm", 628 | "windows_aarch64_msvc", 629 | "windows_i686_gnu", 630 | "windows_i686_gnullvm", 631 | "windows_i686_msvc", 632 | "windows_x86_64_gnu", 633 | "windows_x86_64_gnullvm", 634 | "windows_x86_64_msvc", 635 | ] 636 | 637 | [[package]] 638 | name = "windows_aarch64_gnullvm" 639 | version = "0.52.5" 640 | source = "registry+https://github.com/rust-lang/crates.io-index" 641 | checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" 642 | 643 | [[package]] 644 | name = "windows_aarch64_msvc" 645 | version = "0.52.5" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" 648 | 649 | [[package]] 650 | name = "windows_i686_gnu" 651 | version = "0.52.5" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" 654 | 655 | [[package]] 656 | name = "windows_i686_gnullvm" 657 | version = "0.52.5" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" 660 | 661 | [[package]] 662 | name = "windows_i686_msvc" 663 | version = "0.52.5" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" 666 | 667 | [[package]] 668 | name = "windows_x86_64_gnu" 669 | version = "0.52.5" 670 | source = "registry+https://github.com/rust-lang/crates.io-index" 671 | checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" 672 | 673 | [[package]] 674 | name = "windows_x86_64_gnullvm" 675 | version = "0.52.5" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" 678 | 679 | [[package]] 680 | name = "windows_x86_64_msvc" 681 | version = "0.52.5" 682 | source = "registry+https://github.com/rust-lang/crates.io-index" 683 | checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" 684 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tzt" 3 | version = "0.3.1" 4 | edition = "2021" 5 | license = "MIT" 6 | description = "simple command-line utility that converts a given time from one timezone to another." 7 | homepage = "https://github.com/shunsock/timezone_translator" 8 | repository = "https://github.com/shunsock/timezone_translator" 9 | documentation = "https://github.com/shunsock/timezone_translator/blob/main/README.md" 10 | readme = "README.md" 11 | keywords = ["timezone", "time", "converter", "translator", "cli"] 12 | categories = ["command-line-utilities"] 13 | 14 | [dependencies] 15 | assert_cmd = "2.0" 16 | chrono = "0.4" 17 | chrono-tz = "0.10" 18 | clap = "4.5" 19 | predicates = "3.1" 20 | regex = "1.11.1" 21 | thiserror = "2.0.12" 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2024 Scott Chacon and others 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: install uninstall test 2 | 3 | install: 4 | cargo build --release 5 | sudo cp target/release/timezone_translator /usr/local/bin/tzt 6 | 7 | uninstall: 8 | sudo rm /usr/local/bin/tzt 9 | 10 | test: 11 | cargo build 12 | cargo fmt 13 | cargo clippy 14 | cargo test 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | tzt 4 | 5 |
6 | 7 |

8 | tzt - Timezone Translator 9 |

10 |

11 | simple command-line utility that converts a given time from one timezone to another. 12 |

13 | 14 |

15 | 16 | LICENSE 17 | 18 | rust 19 | 20 | workflow 21 |

22 | 23 | ## Features 24 | - Convert a given time from one timezone to another. 25 | - Supports multiple timezones. 26 | - if you want to see the list of supported timezones, read following url. 27 | - https://docs.rs/chrono-tz/latest/chrono_tz/enum.Tz.html 28 | 29 | ## Usage 30 | You can use the following command to see the help message. 31 | 32 | ```bash 33 | $tzt --help 34 | translate time from one timezone to another 35 | 36 | Usage: tzt [OPTIONS] --time