{"id":26076825,"url":"https://github.com/purescript-contrib/purescript-now","last_synced_at":"2026-03-14T03:02:25.131Z","repository":{"id":8915121,"uuid":"60221261","full_name":"purescript-contrib/purescript-now","owner":"purescript-contrib","description":"Effect type and functions for accessing the current machine's date and time.","archived":false,"fork":false,"pushed_at":"2022-04-27T22:59:45.000Z","size":94,"stargazers_count":19,"open_issues_count":2,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-01T04:15:32.519Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PureScript","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/purescript-contrib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-02T00:58:47.000Z","updated_at":"2024-03-31T14:11:40.000Z","dependencies_parsed_at":"2022-08-07T05:00:16.637Z","dependency_job_id":null,"html_url":"https://github.com/purescript-contrib/purescript-now","commit_stats":null,"previous_names":["garyb/purescript-now"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purescript-contrib%2Fpurescript-now","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purescript-contrib%2Fpurescript-now/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purescript-contrib%2Fpurescript-now/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purescript-contrib%2Fpurescript-now/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/purescript-contrib","download_url":"https://codeload.github.com/purescript-contrib/purescript-now/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242635336,"owners_count":20161437,"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":[],"created_at":"2025-03-09T02:36:03.583Z","updated_at":"2025-12-16T02:09:00.652Z","avatar_url":"https://github.com/purescript-contrib.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Now\n\n[![CI](https://github.com/purescript-contrib/purescript-now/workflows/CI/badge.svg?branch=main)](https://github.com/purescript-contrib/purescript-now/actions?query=workflow%3ACI+branch%3Amain)\n[![Release](https://img.shields.io/github/release/purescript-contrib/purescript-now.svg)](https://github.com/purescript-contrib/purescript-now/releases)\n[![Pursuit](https://pursuit.purescript.org/packages/purescript-now/badge)](https://pursuit.purescript.org/packages/purescript-now)\n[![Maintainer: garyb](https://img.shields.io/badge/maintainer-garyb-teal.svg)](https://github.com/garyb)\n\nEffect type and function for accessing the current machine's date and time.\n\n## Installation\n\nInstall `now` with [Spago](https://github.com/purescript/spago):\n\n```sh\nspago install now\n```\n\n## Quick start\n\nThe functions provided by `now` can be used to get the current date and time from the current machine's system clock.\n\nHere are two example functions that print out the current year and time:\n\n```purs\nimport Prelude\nimport Data.DateTime\nimport Data.Enum\nimport Effect\nimport Effect.Console\nimport Effect.Now\n\nprintCurrentYear :: Effect Unit\nprintCurrentYear = do\n  currentDate \u003c- nowDate\n  let\n    currentYear = fromEnum $ year currentDate :: Int\n  log $ \"The current year is \" \u003c\u003e show currentYear\n\nprintCurrentTime :: Effect Unit\nprintCurrentTime = do\n  currentTime \u003c- nowTime\n  let\n    currentHour = fromEnum $ hour currentTime :: Int\n    currentMinute = fromEnum $ minute currentTime :: Int\n  log $ \"The current time is \" \u003c\u003e show currentHour \u003c\u003e \":\" \u003c\u003e show currentMinute\n```\n\nWe can then try these functions out in a REPL:\n\n```\n\u003e printCurrentYear\nThe current year is 2021\n\n\u003e printCurrentTime\nThe current time is 1:54\n```\n\n## Documentation\n\n`now` documentation is stored in a few places:\n\n1. Module documentation is [published on Pursuit](https://pursuit.purescript.org/packages/purescript-now).\n2. Written documentation is kept in the [docs directory](./docs).\n3. Usage examples can be found in [the test suite](./test).\n\nIf you get stuck, there are several ways to get help:\n\n- [Open an issue](https://github.com/purescript-contrib/purescript-now/issues) if you have encountered a bug or problem.\n- Ask general questions on the [PureScript Discourse](https://discourse.purescript.org) forum or the [PureScript Discord](https://purescript.org/chat) chat.\n\n## Contributing\n\nYou can contribute to `now` in several ways:\n\n1. If you encounter a problem or have a question, please [open an issue](https://github.com/purescript-contrib/purescript-now/issues). We'll do our best to work with you to resolve or answer it.\n\n2. If you would like to contribute code, tests, or documentation, please [read the contributor guide](./CONTRIBUTING.md). It's a short, helpful introduction to contributing to this library, including development instructions.\n\n3. If you have written a library, tutorial, guide, or other resource based on this package, please share it on the [PureScript Discourse](https://discourse.purescript.org)! Writing libraries and learning resources are a great way to help this library succeed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurescript-contrib%2Fpurescript-now","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurescript-contrib%2Fpurescript-now","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurescript-contrib%2Fpurescript-now/lists"}