MCPcopy Index your code
hub / github.com/apache/devlake / ConvertStringToTime

Function ConvertStringToTime

backend/core/models/common/iso8601time.go:172–179  ·  view source on GitHub ↗

ConvertStringToTime FIXME ...

(timeString string)

Source from the content-addressed store, hash-verified

170
171// ConvertStringToTime FIXME ...
172func ConvertStringToTime(timeString string) (t time.Time, err error) {
173 for _, formatItem := range DateTimeFormats {
174 if formatItem.Matcher.MatchString(timeString) {
175 return time.Parse(formatItem.Format, timeString)
176 }
177 }
178 return time.Parse(time.RFC3339, timeString)
179}
180
181// ConvertStringToTimeInLoc converts a string to time.Time in the given location.
182func ConvertStringToTimeInLoc(timeString string, loc *time.Location) (t time.Time, err error) {

Callers 2

UnmarshalJSONMethod · 0.70
TestConvertStringToTimeFunction · 0.70

Calls

no outgoing calls

Tested by 1

TestConvertStringToTimeFunction · 0.56