cslms-api/internal/helpers/helpers.go

20 lines
337 B
Go
Raw Permalink Normal View History

2023-12-27 17:31:49 +09:00
package helpers
import (
"os"
"time"
)
func InLambda() bool {
if lambdaTaskRoot := os.Getenv("LAMBDA_TASK_ROOT"); lambdaTaskRoot != "" {
return true
}
return false
}
func Datetime(timeString string) (time.Time, error) {
layout := "2006-01-02T15:04:05.000Z"
result, err := time.Parse(layout, timeString)
return result, err
}