{"id":16366104,"url":"https://github.com/captn3m0/suntime","last_synced_at":"2025-06-14T11:33:12.980Z","repository":{"id":139926910,"uuid":"266130143","full_name":"captn3m0/suntime","owner":"captn3m0","description":"  Crystal library for calculating sunrise and sunset times.","archived":false,"fork":false,"pushed_at":"2022-05-30T09:20:12.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-30T22:59:25.413Z","etag":null,"topics":["crystal-shard","noaa","sunrise","sunset","time"],"latest_commit_sha":null,"homepage":"https://github.com/captn3m0/suntime","language":"Crystal","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/captn3m0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"ko_fi":"captn3m0","liberapay":"captn3m0","github":"captn3m0"}},"created_at":"2020-05-22T14:26:24.000Z","updated_at":"2022-05-30T09:20:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"f1500544-c9dc-49c1-a02c-5aec7e06be99","html_url":"https://github.com/captn3m0/suntime","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/captn3m0/suntime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captn3m0%2Fsuntime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captn3m0%2Fsuntime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captn3m0%2Fsuntime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captn3m0%2Fsuntime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/captn3m0","download_url":"https://codeload.github.com/captn3m0/suntime/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/captn3m0%2Fsuntime/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259808874,"owners_count":22914728,"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":["crystal-shard","noaa","sunrise","sunset","time"],"created_at":"2024-10-11T02:45:20.785Z","updated_at":"2025-06-14T11:33:12.941Z","avatar_url":"https://github.com/captn3m0.png","language":"Crystal","funding_links":["https://ko-fi.com/captn3m0","https://liberapay.com/captn3m0","https://github.com/sponsors/captn3m0"],"categories":[],"sub_categories":[],"readme":"# suntime\n\nCrystal library for calculating sunrise and sunset times. Uses the algorithm from \u003chttps://www.esrl.noaa.gov/gmd/grad/solcalc/solareqns.PDF\u003e\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     suntime:\n       github: captn3m0/suntime\n   ```\n\n2. Run `shards install`\n\n## Usage\n\n```crystal\nrequire \"suntime\"\n\n# Time is optional, local time is used otherwise\n# It returns sunrise/sunset for TODAY, so if you want the next sunset, check accordingly\ns = Suntime::Suntime.new(lat,long, time)\n# Bangalore\ns = Suntime::Suntime.new(12.955800, 77.620979)\ns.sunrise\n# 2020-05-22 05:52:48.0 +05:30 Local\ns.sunset\n# 2020-05-22 18:39:43.0 +05:30 Local\n```\n\nYou can pass in a different time. The date is used for calculating the sunrise/sunset, and the timezone is used for return formatting.\n\n## TODO\n\n- [ ] Implement the Atmospheric Refraction Effect calculation\n- [ ] Uncomment true_solar_time after converting it to proper time object\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/captn3m0/suntime/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Nemo](https://github.com/captn3m0) - creator and maintainer\n\n## License\n\nLicensed under the [MIT License](https://nemo.mit-license.org/). See LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaptn3m0%2Fsuntime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaptn3m0%2Fsuntime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaptn3m0%2Fsuntime/lists"}