{"id":23564208,"url":"https://github.com/selectel/tempo","last_synced_at":"2025-08-18T01:34:29.993Z","repository":{"id":3469250,"uuid":"4523893","full_name":"selectel/tempo","owner":"selectel","description":"NIF-based date and time parsing and formatting for Erlang","archived":false,"fork":false,"pushed_at":"2022-11-24T14:57:54.000Z","size":82,"stargazers_count":67,"open_issues_count":3,"forks_count":10,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-07-30T18:38:23.326Z","etag":null,"topics":["community","datetime","erlang"],"latest_commit_sha":null,"homepage":"","language":"Erlang","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/selectel.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}},"created_at":"2012-06-01T20:20:15.000Z","updated_at":"2024-08-20T09:41:55.000Z","dependencies_parsed_at":"2023-01-11T16:16:54.783Z","dependency_job_id":null,"html_url":"https://github.com/selectel/tempo","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/selectel/tempo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Ftempo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Ftempo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Ftempo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Ftempo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selectel","download_url":"https://codeload.github.com/selectel/tempo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Ftempo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270932578,"owners_count":24670240,"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-08-17T02:00:09.016Z","response_time":129,"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":["community","datetime","erlang"],"created_at":"2024-12-26T17:13:20.865Z","updated_at":"2025-08-18T01:34:29.965Z","avatar_url":"https://github.com/selectel.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# tempo [![Build Status](https://github.com/selectel/tempo/workflows/build/badge.svg)](https://github.com/selectel/tempo) #\n\n__Authors:__ Dmitry Groshev ([`lambdadmitry@gmail.com`](mailto:lambdadmitry@gmail.com)), Sergei Levedev ([`superbobry@gmail.com`](mailto:superbobry@gmail.com)).\n\n\n`tempo` is a library for parsing and formatting dates in\nErlang. It provides a clean and nice interface to libc's\n[strptime](http://linux.die.net/man/3/strptime) and\n[strftime](http://linux.die.net/man/3/strftime) functions,\nwhich are unfortunately missing from Erlang's standard library.\n\n\n### \u003ca name=\"Is_it_any_good?\"\u003eIs it any good?\u003c/a\u003e ###\n\n\nYes.\n\n\n### \u003ca name=\"How_can_I_use_it?\"\u003eHow can I use it?\u003c/a\u003e ###\n\nThe only two functions you have to remember are [`tempo:parse/2`](https://github.com/selectel/tempo/blob/master/doc/tempo.md#parse-2)\nand [`tempo:format/2`](https://github.com/selectel/tempo/blob/master/doc/tempo.md#format-2). Here are some examples:\n\n```\n1\u003e {ok, Bin} = tempo:format(iso8601, {now, now()}).\n{ok,\u003c\u003c\"2016-01-11T19:25:26Z\"\u003e\u003e}\n2\u003e tempo:parse(iso8601, {datetime, Bin}).\n{ok,{{2016,1,11},{19,25,26}}}\n```\n\nAs you might have noticed, both of the functions follow a common\npattern -- *Format* first, then a *Value*, tagged by its actual\nor expected type. Predefined formats include: `iso8601`, `rfc1123`,\nand `rfc2822`, but in fact, you can use any format, as long as it\nfollows libc conventions:\n\n```\n(tempo_dev@localhost)1\u003e {ok, Bin} = tempo:format(\u003c\u003c\"%A, %Y-%d-%m\"\u003e\u003e, {now, now()}).\n{ok,\u003c\u003c\"Thursday, 2012-07-06\"\u003e\u003e}\n```\n\n\n### \u003ca name=\"Limitations\"\u003eLimitations\u003c/a\u003e ###\n\nUnfortunately, dealing with time on various platforms is messy, so limitations are\nunavoidable. Here's a shortlist of those we know of:\n* Parsing years before `1900` causes a `{error, format_mismatch}` on OS X.\n\n\n## Modules ##\n\n\n\u003ctable width=\"100%\" border=\"0\" summary=\"list of modules\"\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/selectel/tempo/blob/master/doc/tempo.md\" class=\"module\"\u003etempo\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselectel%2Ftempo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselectel%2Ftempo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselectel%2Ftempo/lists"}