{"id":19335678,"url":"https://github.com/rlxone/solarnoaa","last_synced_at":"2025-04-23T00:32:07.110Z","repository":{"id":51233122,"uuid":"145563745","full_name":"rlxone/SolarNOAA","owner":"rlxone","description":"🌞 Calculation of local times of sunrise, solar noon, sunset, azimuth, elevation based on the calculation procedure by NOAA","archived":false,"fork":false,"pushed_at":"2021-05-19T18:30:43.000Z","size":116,"stargazers_count":31,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T18:16:41.291Z","etag":null,"topics":["azimuth","elevation","solar","sunrise","sunset","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/rlxone.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":"2018-08-21T12:53:03.000Z","updated_at":"2024-11-20T02:23:18.000Z","dependencies_parsed_at":"2022-09-10T08:51:55.692Z","dependency_job_id":null,"html_url":"https://github.com/rlxone/SolarNOAA","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlxone%2FSolarNOAA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlxone%2FSolarNOAA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlxone%2FSolarNOAA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlxone%2FSolarNOAA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rlxone","download_url":"https://codeload.github.com/rlxone/SolarNOAA/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250348327,"owners_count":21415894,"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":["azimuth","elevation","solar","sunrise","sunset","swift"],"created_at":"2024-11-10T03:08:30.344Z","updated_at":"2025-04-23T00:32:06.769Z","avatar_url":"https://github.com/rlxone.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"500\" height=\"379\" src=\"https://user-images.githubusercontent.com/8312717/118853830-dae9bf80-b8dc-11eb-8bef-2a25b0235460.png\" /\u003e\n\u003c/p\u003e\n\n# SolarNOAA\nCalculation of local times of `sunrise`, `solar noon`, `sunset`, `azimuth`, `elevation` based on the calculation procedure by [NOAA](http://www.srrb.noaa.gov/highlights/sunrise/sunrise.html)\n\n## Installation\n### CocoaPods\n[CocoaPods](https://cocoapods.org/) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate **SolarNOAA** into your Xcode project using CocoaPods, specify it in your `Podfile`:\n```ruby\npod 'SolarNOAA', '~\u003e 1.0.0'\n```\n\n### Carthage\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate **SolarNOAA** into your Xcode project using Carthage, specify it in your `Cartfile`:\n```ruby\ngithub \"rlxone/SolarNOAA\" ~\u003e 1.0.0\n```\n\n### Swift Package Manager\n[Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the swift compiler.\n\nOnce you have your Swift package set up, adding **SolarNOAA** as a dependency is as easy as adding it to the dependencies value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/rlxone/SolarNOAA.git\", .upToNextMajor(from: \"1.0.0\"))\n]\n```\n\n## Requirements\n- **iOS** 9.0 / **macOS** 10.9 / **tvOS** 9.0 / **watchOS** 2.0\n- Swift 5\n\n## Usage\n```swift\n// Chicago coordinates\nlet latitude = 41.881832\nlet longitude = -87.623177\n                \n// Timezone for UTC-5\nlet timezone = -5\n                \n// Get current date\nlet date = Date()\nvar calendar = Calendar.current\ncalendar.timeZone = TimeZone(identifier: \"UTC\")!\n                \nlet year = calendar.component(.year, from: date)\nlet month = calendar.component(.month, from: date)\nlet day = calendar.component(.day, from: date)\n                \n// Get sunrise and sunset in days\nlet sunriseDaysTime = Solar.sunrise(lat: latitude, lon: longitude, year: year, month: month, day: day, timezone: timezone, dlstime: 0)\nlet sunsetDaysTime = Solar.sunset(lat: latitude, lon: longitude, year: year, month: month, day: day, timezone: timezone, dlstime: 0)\n                \n// Get date from sunrise and sunset days value\nlet sunriseDate = Date(timeIntervalSince1970: sunriseDaysTime * 24 * 60 * 60)\nlet sunsetDate = Date(timeIntervalSince1970: sunsetDaysTime * 24 * 60 * 60)\n                \nlet timeFormatter = DateFormatter()\ntimeFormatter.dateFormat = \"HH:mm:ss\"\ntimeFormatter.timeZone = TimeZone(identifier: \"UTC\")\n                \nlet dateFormatter = DateFormatter()\ndateFormatter.dateFormat = \"EEEE, MMM d, yyyy\"\ndateFormatter.timeZone = TimeZone(identifier: \"UTC\")\n                \nprint(\"Chicago sunrise for \\(dateFormatter.string(from: date)): \\(timeFormatter.string(from: sunriseDate))\")\nprint(\"Chicago sunset for \\(dateFormatter.string(from: date)): \\(timeFormatter.string(from: sunsetDate))\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlxone%2Fsolarnoaa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frlxone%2Fsolarnoaa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlxone%2Fsolarnoaa/lists"}