github.com/MontFerret/ferret@v0.18.0/pkg/stdlib/datetime/lib.go (about) 1 package datetime 2 3 import "github.com/MontFerret/ferret/pkg/runtime/core" 4 5 func RegisterLib(ns core.Namespace) error { 6 return ns.RegisterFunctions( 7 core.NewFunctionsFromMap(map[string]core.Function{ 8 "NOW": Now, 9 "DATE": Date, 10 "DATE_COMPARE": DateCompare, 11 "DATE_DAYOFWEEK": DateDayOfWeek, 12 "DATE_YEAR": DateYear, 13 "DATE_MONTH": DateMonth, 14 "DATE_DAY": DateDay, 15 "DATE_HOUR": DateHour, 16 "DATE_MINUTE": DateMinute, 17 "DATE_SECOND": DateSecond, 18 "DATE_MILLISECOND": DateMillisecond, 19 "DATE_DAYOFYEAR": DateDayOfYear, 20 "DATE_LEAPYEAR": DateLeapYear, 21 "DATE_QUARTER": DateQuarter, 22 "DATE_DAYS_IN_MONTH": DateDaysInMonth, 23 "DATE_FORMAT": DateFormat, 24 "DATE_ADD": DateAdd, 25 "DATE_SUBTRACT": DateSubtract, 26 "DATE_DIFF": DateDiff, 27 }), 28 ) 29 }