Files
calculate_negative_points/internal/utils/first_day_of_month.go
Eugene Howe b0957bfa49
Some checks failed
Docker Build and Publish / publish (push) Failing after 1m33s
webapp
2026-02-17 09:47:30 -05:00

21 lines
452 B
Go

package utils
import "time"
func FirstDayOfMonth() string {
// Load America/Detroit timezone
loc, err := time.LoadLocation("America/Detroit")
if err != nil {
panic(err)
}
// Get current time in Detroit timezone
now := time.Now().In(loc)
// Create midnight of the first day of the current month
firstDay := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, loc)
// Return ISO8601 formatted string
return firstDay.Format(time.RFC3339)
}