🌟 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
go version
If you don't have Go
installed, you can download it from here.
Add to your project
Run the following command in the console
, in the project directory
, to install the library with go get
go get github.com/ggoodwin/go-nyse-time
Importing
Add the import to your .go
file
import nyse_time "github.com/ggoodwin/go-nyse-time"
💰 Usage
Check if the Market is Open at Current Time
// Returns: bool
open := nyse_time.IsMarketOpen()
Check if the Market will be Open based on a specific time and date
// Parameters: time.Time
// Returns: bool
open := nyse_time.IsMarketOpenCustom(time.Time)
Is It A Holiday?
// Parameters: time.Time
// Returns: bool
isHoliday := nyse_time.IsHoliday(time.Time)
Is It An Early Close Day?
// Parameters: time.Time
// Returns: bool
isEarlyClose := nyse_time.IsEarlyClose(time.Time)
Is It A Weekend?
// Parameters: time.Time
// Returns: bool
isWeekend := nyse_time.IsWeekend(time.Time)
💻 Dependencies
🙇♂️ 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.