mirror of
https://github.com/MontFerret/ferret.git
synced 2025-03-19 21:28:32 +02:00
* Added release notes * #509 fixedOCOD typo * Updated values * Updated comments * Changed stdlib docs format * Changed format of array in docs * Use 'any' instead of 'value' in docs * New format for optional params * Updated docs for testing package * Added namespace information
21 lines
452 B
Go
21 lines
452 B
Go
package datetime
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/MontFerret/ferret/pkg/runtime/values"
|
|
|
|
"github.com/MontFerret/ferret/pkg/runtime/core"
|
|
)
|
|
|
|
// NOW returns new DateTime object with Time equal to time.Now().
|
|
// @return {DateTime} - New DateTime object.
|
|
func Now(_ context.Context, args ...core.Value) (core.Value, error) {
|
|
err := core.ValidateArgs(args, 0, 0)
|
|
if err != nil {
|
|
return values.None, err
|
|
}
|
|
|
|
return values.NewCurrentDateTime(), nil
|
|
}
|