Accurate solar power forecasting is essential to mitigate the variability and uncertainty of solar power generation and integrate renewable energy sources into power grids. A multi-step Long Short Term Memory (LSTM)-based model is proposed for solar power generation forecasting using online learning. To capture daily fluctuations in solar energy patterns, the model employs a dynamic sunrise–sunset data window operation, ensuring that the relevant transitions in solar irradiance are accurately represented in the training set. For seasonality analysis, the variance of the correlation of features with solar power output is determined across different months of the year. The simulation results show that the proposed LSTM-based online learning model achieves a mean absolute percentage error of less than 1%. The results demonstrate that incorporating solar transition period information significantly enhances the forecasting accuracy of the proposed model. Online learning exhibits higher performance than batch learning in terms of forecasting accuracy.