fa-sdk-go/pkg/furaffinaty/utils/date.go
SoXX 18c7bcf1db feat: initial commit
initial POC for a SDK
2024-08-06 15:32:42 +02:00

17 lines
288 B
Go

package utils
import (
"errors"
"time"
)
const inputFormat = "Jan 2, 2006 03:04 PM"
func ParseDate(input string) (time.Time, error) {
t, err := time.Parse(inputFormat, input)
if err != nil {
return time.Time{}, errors.New("Cannot parse time: " + err.Error())
}
return t, nil
}