{"id":19839004,"url":"https://github.com/objectionary/eo-time","last_synced_at":"2026-03-02T22:33:57.181Z","repository":{"id":41532058,"uuid":"510082372","full_name":"objectionary/eo-time","owner":"objectionary","description":"EO Objects for Date and Time Parsing and Printing","archived":false,"fork":false,"pushed_at":"2024-06-02T20:40:51.000Z","size":6,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T11:19:28.499Z","etag":null,"topics":["datetime","eolang","oop"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/objectionary.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}},"created_at":"2022-07-03T16:52:08.000Z","updated_at":"2024-06-02T21:33:51.000Z","dependencies_parsed_at":"2022-07-07T22:12:25.009Z","dependency_job_id":null,"html_url":"https://github.com/objectionary/eo-time","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectionary%2Feo-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectionary%2Feo-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectionary%2Feo-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectionary%2Feo-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/objectionary","download_url":"https://codeload.github.com/objectionary/eo-time/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241209528,"owners_count":19927734,"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":["datetime","eolang","oop"],"created_at":"2024-11-12T12:19:52.498Z","updated_at":"2026-03-02T22:33:52.151Z","avatar_url":"https://github.com/objectionary.png","language":null,"readme":"\u003cimg src=\"https://www.yegor256.com/images/books/elegant-objects/cactus.svg\" height=\"100px\" /\u003e\n\n[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)\n[![DevOps By Rultor.com](http://www.rultor.com/b/objectionary/eo-time)](http://www.rultor.com/p/objectionary/eo-time)\n[![We recommend IntelliJ IDEA](https://www.elegantobjects.org/intellij-idea.svg)](https://www.jetbrains.com/idea/)\n\n[![Hits-of-Code](https://hitsofcode.com/github/objectionary/eo-time)](https://hitsofcode.com/view/github/objectionary/eo-time)\n![Lines of code](https://img.shields.io/tokei/lines/github/objectionary/eo-time)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/objectionary/eo-time/blob/master/LICENSE.txt)\n\n[EO](https://www.eolang.org) objects for date/time manipulations.\n\nTo get current time:\n\n```\nQQ.dt.now \u003e t\n```\n\nTo make time from absolute value in **nano-seconds** after Epoch:\n\n```\nQQ.dt.time \u003e t\n  1656855443000000\n```\n\nTo make short time interval:\n\n```\nQQ.dt.nanosecond.mul 10 \u003e ten-ns\nQQ.dt.microsecond.mul 50 \u003e fifty-mcs\nQQ.dt.millisecond.mul 100 \u003e hundred-ms\nQQ.dt.second.mul 3 \u003e three-seconds\nQQ.dt.minute.mul 4 \u003e four-minutes\nQQ.dt.hour.mul 5 \u003e five-hours\nQQ.dt.day \u003e one-day\nQQ.dt.week.mul 2 \u003e two-weeks\n```\n\nTo print it in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format\nusing [strftime](https://man7.org/linux/man-pages/man3/strftime.3.html):\n\n```\nQQ.io.stdout\n  QQ.txt.sprintf\n    \"Current time is %s\"\n    QQ.dt.strftime\n      \"%Y-%m-%dT%H:%M:%S%z\"\n      t\n```\n\nTo parse [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) back to time\nusing [strptime](https://man7.org/linux/man-pages/man3/strptime.3.html):\n\n```\nQQ.dt.strptime \u003e t\n  \"%Y-%m-%dT%H:%M:%S%z\"\n  \"2022-07-03T20:26:09+0300\"\n```\n\nThe object `QQ.dt.time` has the following attributes:\n\n  * `plus` adds two times\n  * `minus` subtracts\n  * `eq` compares\n  * `gt` is TRUE if greater than\n  * `gte` if greater than or equal\n  * `lt` if less than\n  * `lte` if less than or equal\n\nFor example, to add five hours and thirty minutes to the current time and then compare it with the time of file creation:\n\n```\nQQ.io.stdout\n  if.\n    gt.\n      plus.\n        QQ.dt.now\n        QQ.dt.hour.mul 5\n        QQ.dt.minute.mul 30\n      utime.\n        QQ.fs.file\n          \"test.txt\"\n    \"The file is too old\"\n    \"The file is fresh\"\n```\n\nThere are two objects that are aware of calendar specifics and must be\nused on the left side of the equation in order to respect the calendar. The following\ncode will move current time three months ahead:\n\n```\nplus\n  QQ.dt.month.mul 3\n  QQ.dt.now\n```\n\n## How to Contribute\n\nFork repository, make changes, send us a pull request.\nWe will review your changes and apply them to the `master` branch shortly,\nprovided they don't violate our quality standards. To avoid frustration,\nbefore sending us your pull request please run full Maven build:\n\n```bash\n$ mvn clean install -Pqulice\n```\n\nYou will need Maven 3.3+ and Java 8+.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectionary%2Feo-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobjectionary%2Feo-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectionary%2Feo-time/lists"}