format_utility.go
447 Bytes
package restutility
import (
"time"
)
func UnixToDate(unix int64) time.Time {
return time.Unix(unix, 0)
}
func DateToUnix(date interface{}) int64 {
if date != nil {
t := date.(time.Time)
return t.Unix()
}
return 0
}
func EqualQuotes(stmt string) string {
if stmt != "" {
stmt = " = '" + stmt + "'"
}
return stmt
}
func LikeQuotes(stmt string) string {
if stmt != "" {
stmt " LIKE UPPER('%" + stmt + "%')"
}
return stmt
}