mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-21 01:21:34 +02:00
21 lines
453 B
Go
21 lines
453 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().
|
||
|
// @returns (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
|
||
|
}
|