{"id":13587135,"url":"https://github.com/waltzofpearls/dateparser","last_synced_at":"2025-08-04T06:18:28.904Z","repository":{"id":49121927,"uuid":"363061399","full_name":"waltzofpearls/dateparser","owner":"waltzofpearls","description":"Parse dates in commonly used string formats with Rust.","archived":false,"fork":false,"pushed_at":"2024-03-06T00:27:25.000Z","size":106,"stargazers_count":36,"open_issues_count":10,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-09T08:23:23.123Z","etag":null,"topics":["chrono","cli","dateparser","datetime","lib","rust","timezones"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/waltzofpearls.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":"2021-04-30T07:26:47.000Z","updated_at":"2024-06-03T01:57:57.206Z","dependencies_parsed_at":"2024-06-03T02:07:53.307Z","dependency_job_id":null,"html_url":"https://github.com/waltzofpearls/dateparser","commit_stats":null,"previous_names":["waltzofpearls/belt"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waltzofpearls%2Fdateparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waltzofpearls%2Fdateparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waltzofpearls%2Fdateparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waltzofpearls%2Fdateparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waltzofpearls","download_url":"https://codeload.github.com/waltzofpearls/dateparser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223290386,"owners_count":17120906,"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":["chrono","cli","dateparser","datetime","lib","rust","timezones"],"created_at":"2024-08-01T15:06:02.446Z","updated_at":"2024-11-06T05:31:14.491Z","avatar_url":"https://github.com/waltzofpearls.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# [dateparser](https://crates.io/crates/dateparser)\n\n[![Build Status][actions-badge]][actions-url]\n[![MIT licensed][mit-badge]][mit-url]\n[![Crates.io][cratesio-badge]][cratesio-url]\n[![Doc.rs][docrs-badge]][docrs-url]\n\n[actions-badge]: https://github.com/waltzofpearls/dateparser/workflows/ci/badge.svg\n[actions-url]: https://github.com/waltzofpearls/dateparser/actions?query=workflow%3Aci+branch%3Amain\n[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg\n[mit-url]: https://github.com/waltzofpearls/dateparser/blob/main/LICENSE\n[cratesio-badge]: https://img.shields.io/crates/v/dateparser.svg\n[cratesio-url]: https://crates.io/crates/dateparser\n[docrs-badge]: https://docs.rs/dateparser/badge.svg\n[docrs-url]: https://docs.rs/crate/dateparser/\n\nParse dates in commonly used string formats with Rust.\n\nThis repo contains 2 cargo workspaces:\n\n- [dateparser](./dateparser): Rust crate for parsing date strings in commonly used formats.\n- [belt](./belt): Command-line tool that can display a given time in a list of selected time zones.\n  It also serves as an example showcasing how you could use dateparser in your project.\n\n## [`dateparser`](./dateparser) crate\n\n```rust\nuse dateparser::parse;\nuse std::error::Error;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    let parsed = parse(\"6:15pm\")?;\n    println!(\"{:#?}\", parsed);\n    Ok(())\n}\n```\n\nWill parse the input `6:15pm` and print parsed date and time in UTC time zone as `2023-03-26T01:15:00Z`.\nMore about this crate on [Docs.rs][1] and in [examples][2] folder\n\n[1]: https://docs.rs/dateparser/latest/dateparser\n[2]: ./dateparser/examples\n\n#### Accepted date formats\n\n```rust\n// unix timestamp\n\"1511648546\",\n\"1620021848429\",\n\"1620024872717915000\",\n// rfc3339\n\"2021-05-01T01:17:02.604456Z\",\n\"2017-11-25T22:34:50Z\",\n// rfc2822\n\"Wed, 02 Jun 2021 06:31:39 GMT\",\n// postgres timestamp yyyy-mm-dd hh:mm:ss z\n\"2019-11-29 08:08-08\",\n\"2019-11-29 08:08:05-08\",\n\"2021-05-02 23:31:36.0741-07\",\n\"2021-05-02 23:31:39.12689-07\",\n\"2019-11-29 08:15:47.624504-08\",\n\"2017-07-19 03:21:51+00:00\",\n// yyyy-mm-dd hh:mm:ss\n\"2014-04-26 05:24:37 PM\",\n\"2021-04-30 21:14\",\n\"2021-04-30 21:14:10\",\n\"2021-04-30 21:14:10.052282\",\n\"2014-04-26 17:24:37.123\",\n\"2014-04-26 17:24:37.3186369\",\n\"2012-08-03 18:31:59.257000000\",\n// yyyy-mm-dd hh:mm:ss z\n\"2017-11-25 13:31:15 PST\",\n\"2017-11-25 13:31 PST\",\n\"2014-12-16 06:20:00 UTC\",\n\"2014-12-16 06:20:00 GMT\",\n\"2014-04-26 13:13:43 +0800\",\n\"2014-04-26 13:13:44 +09:00\",\n\"2012-08-03 18:31:59.257000000 +0000\",\n\"2015-09-30 18:48:56.35272715 UTC\",\n// yyyy-mm-dd\n\"2021-02-21\",\n// yyyy-mm-dd z\n\"2021-02-21 PST\",\n\"2021-02-21 UTC\",\n\"2020-07-20+08:00\",\n// hh:mm:ss\n\"01:06:06\",\n\"4:00pm\",\n\"6:00 AM\",\n// hh:mm:ss z\n\"01:06:06 PST\",\n\"4:00pm PST\",\n\"6:00 AM PST\",\n\"6:00pm UTC\",\n// Mon dd hh:mm:ss\n\"May 6 at 9:24 PM\",\n\"May 27 02:45:27\",\n// Mon dd, yyyy, hh:mm:ss\n\"May 8, 2009 5:57:51 PM\",\n\"September 17, 2012 10:09am\",\n\"September 17, 2012, 10:10:09\",\n// Mon dd, yyyy hh:mm:ss z\n\"May 02, 2021 15:51:31 UTC\",\n\"May 02, 2021 15:51 UTC\",\n\"May 26, 2021, 12:49 AM PDT\",\n\"September 17, 2012 at 10:09am PST\",\n// yyyy-mon-dd\n\"2021-Feb-21\",\n// Mon dd, yyyy\n\"May 25, 2021\",\n\"oct 7, 1970\",\n\"oct 7, 70\",\n\"oct. 7, 1970\",\n\"oct. 7, 70\",\n\"October 7, 1970\",\n// dd Mon yyyy hh:mm:ss\n\"12 Feb 2006, 19:17\",\n\"12 Feb 2006 19:17\",\n\"14 May 2019 19:11:40.164\",\n// dd Mon yyyy\n\"7 oct 70\",\n\"7 oct 1970\",\n\"03 February 2013\",\n\"1 July 2013\",\n// mm/dd/yyyy hh:mm:ss\n\"4/8/2014 22:05\",\n\"04/08/2014 22:05\",\n\"4/8/14 22:05\",\n\"04/2/2014 03:00:51\",\n\"8/8/1965 12:00:00 AM\",\n\"8/8/1965 01:00:01 PM\",\n\"8/8/1965 01:00 PM\",\n\"8/8/1965 1:00 PM\",\n\"8/8/1965 12:00 AM\",\n\"4/02/2014 03:00:51\",\n\"03/19/2012 10:11:59\",\n\"03/19/2012 10:11:59.3186369\",\n// mm/dd/yyyy\n\"3/31/2014\",\n\"03/31/2014\",\n\"08/21/71\",\n\"8/1/71\",\n// yyyy/mm/dd hh:mm:ss\n\"2014/4/8 22:05\",\n\"2014/04/08 22:05\",\n\"2014/04/2 03:00:51\",\n\"2014/4/02 03:00:51\",\n\"2012/03/19 10:11:59\",\n\"2012/03/19 10:11:59.3186369\",\n// yyyy/mm/dd\n\"2014/3/31\",\n\"2014/03/31\",\n// mm.dd.yyyy\n\"3.31.2014\",\n\"03.31.2014\",\n\"08.21.71\",\n// yyyy.mm.dd\n\"2014.03.30\",\n\"2014.03\",\n// yymmdd hh:mm:ss mysql log\n\"171113 14:14:20\",\n// chinese yyyy mm dd hh mm ss\n\"2014年04月08日11时25分18秒\",\n// chinese yyyy mm dd\n\"2014年04月08日\",\n```\n\n## [`belt`](./belt) CLI tool\n\nRun `belt` to parse a given date:\n\n```shell\n$\u003e belt 'MAY 12, 2021 16:44 UTC'\n+-------------------+---------------------------+\n| Zone              | Date \u0026 Time               |\n+===================+===========================+\n| Local             | 2021-05-12 09:44:00 -0700 |\n|                   | 1620837840                |\n+-------------------+---------------------------+\n| UTC               | 2021-05-12 16:44:00 +0000 |\n|                   | 2021-05-12 16:44 UTC      |\n+-------------------+---------------------------+\n| America/Vancouver | 2021-05-12 09:44:00 -0700 |\n|                   | 2021-05-12 09:44 PDT      |\n+-------------------+---------------------------+\n| America/New_York  | 2021-05-12 12:44:00 -0400 |\n|                   | 2021-05-12 12:44 EDT      |\n+-------------------+---------------------------+\n| Europe/London     | 2021-05-12 17:44:00 +0100 |\n|                   | 2021-05-12 17:44 BST      |\n+-------------------+---------------------------+\n```\n\n#### Installation\n\nMacOS Homebrew or Linuxbrew:\n\n```shell\nbrew tap waltzofpearls/belt\nbrew install belt\n```\n\n## How to make a new release\n\nList files that need to be updated with new version number:\n\n```shell\nmake show-version-files\n```\n\nIt will output something like this:\n\n```shell\n./dateparser/Cargo.toml:3:version = \"0.1.5\"\n./dateparser/README.md:26:dateparser = \"0.1.5\"\n./dateparser/README.md:60:dateparser = \"0.1.5\"\n./belt/Cargo.toml:3:version = \"0.1.5\"\n```\n\nNext, automatically bump the version with `make bump-version` or manually update verion numbers in\nthose listed files. When auto incrementing version with `make bump-version`, it will only bump the\npatch version, for example, 0.1.5 will become 0.1.6. Automatic version bump will create a git branch,\ncommit and push the changes. You will need to create a pull request from GitHub to merge those changes\nfrom the git branch that's automatically created.\n\n**NOTE**: if those files with version numbers are manually edited, then you will need to run `cargo update`\nto update `dateparser` and `belt` versions in the `Cargo.lock` file, and then git commit and push those\nchanges to a git branch, and create a pull request from that branch.\n\nOnce the pull request is merged and those files are updated, run the following command to tag a new\nversion with git and push the new tag to GitHub. This will trigger a build and release workflow run\nin GitHub Actions:\n\n```shell\nmake release\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaltzofpearls%2Fdateparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaltzofpearls%2Fdateparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaltzofpearls%2Fdateparser/lists"}