https://github.com/ggoodwin/go-nyse-time
Go library that tells you whether the New York Stock Exchange is open or not.
https://github.com/ggoodwin/go-nyse-time
go golang holidays library market-hours nyse nyse-stocks schedule stock stocks time
Last synced: 6 months ago
JSON representation
Go library that tells you whether the New York Stock Exchange is open or not.
- Host: GitHub
- URL: https://github.com/ggoodwin/go-nyse-time
- Owner: ggoodwin
- License: mit
- Created: 2023-01-18T05:08:57.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-27T21:10:30.000Z (about 3 years ago)
- Last Synced: 2025-06-04T00:23:16.139Z (about 1 year ago)
- Topics: go, golang, holidays, library, market-hours, nyse, nyse-stocks, schedule, stock, stocks, time
- Language: Go
- Homepage: https://go-nyse-time.greg.id/go-nyse-time
- Size: 86.9 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README

New York Stock Exchange (NYSE) Time Go Library
[](https://discord.id/?prefill=179795086543028224) [](https://discord.gg/jwEYR2Dume)
[](https://pkg.go.dev/github.com/ggoodwin/go-nyse-time) [](https://go.dev/)  [](https://github.com/ggoodwin/go-nyse-time/commits/master) [](https://github.com/ggoodwin/go-nyse-time/blob/master/LICENSE.md)
[](https://goreportcard.com/report/github.com/ggoodwin/go-nyse-time) [](https://www.codefactor.io/repository/github/ggoodwin/go-nyse-time) [](https://app.codacy.com/gh/ggoodwin/go-nyse-time/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [](https://codecov.io/gh/ggoodwin/go-nyse-time)
[](https://github.com/ggoodwin/go-nyse-time/actions/workflows/build.yml) [](https://github.com/ggoodwin/go-nyse-time/actions/workflows/lint.yml) [](https://github.com/ggoodwin/go-nyse-time/actions/workflows/github-code-scanning/codeql)
## 🌟 How it works
The library uses the current time to determine if the market is open, closed, or closed early. It also determines if the current day is a holiday.
## 📦 Installation and Usage
### Go
Make sure you have `Go` installed on your machine.
You can check by running the following command in the `console`
```plain
go version
```
If you don't have `Go` installed, you can download it from [here](https://go.dev/dl/).
### Add to your project
Run the following command in the `console`, in the `project directory`, to install the library with `go get`
```plain
go get github.com/ggoodwin/go-nyse-time
```
### Importing
Add the import to your `.go` file
```go
import nyse_time "github.com/ggoodwin/go-nyse-time"
```
## 💰 Usage
### Check if the Market is Open at Current Time
```go
// Returns: bool
open := nyse_time.IsMarketOpen()
```
### Check if the Market will be Open based on a specific time and date
```go
// Parameters: time.Time
// Returns: bool
open := nyse_time.IsMarketOpenCustom(time.Time)
```
### Is It A Holiday?
```go
// Parameters: time.Time
// Returns: bool
isHoliday := nyse_time.IsHoliday(time.Time)
```
### Is It An Early Close Day?
```go
// Parameters: time.Time
// Returns: bool
isEarlyClose := nyse_time.IsEarlyClose(time.Time)
```
### Is It A Weekend?
```go
// Parameters: time.Time
// Returns: bool
isWeekend := nyse_time.IsWeekend(time.Time)
```
## 💻 Dependencies
- [`Go`](https://go.dev/)
## 🙇♂️ Issues and Contributing
If you find an issue with this library, please report the issue using our [GITHUB-ISSUES] or check out the [SECURITY] details if it is security related.
If you'd like, I welcome any contributions. Please read the [CONTRIBUTING] document then [FORK] this library and submit a [PULL-REQUEST]. Make sure to click `compare across forks` to see your fork.
## ⚖️ License
This project is under the MIT License. See the [LICENSE] file for the full license text.
## 📜 Changes
Check out our [CHANGELOG]
## 👍🏻 Code of Conduct
Please read my [CODE-OF-CONDUCT] before contributing or engaging in discussions.
[LICENSE]: https://github.com/ggoodwin/go-nyse-time/blob/master/LICENSE.md
[CHANGELOG]: https://github.com/ggoodwin/go-nyse-time/blob/master/CHANGELOG.md
[SECURITY]: https://github.com/ggoodwin/go-nyse-time/blob/master/SECURITY.md
[FORK]: https://github.com/ggoodwin/go-nyse-time/fork
[PULL-REQUEST]: https://github.com/ggoodwin/go-nyse-time/compare
[CODE-OF-CONDUCT]: https://github.com/ggoodwin/go-nyse-time/blob/master/CODE_OF_CONDUCT.md
[CONTRIBUTING]: https://github.com/ggoodwin/go-nyse-time/blob/master/CONTRIBUTING.md
[GITHUB-ISSUES]: https://github.com/ggoodwin/go-nyse-time/issues