Skip to content
Node: moment, dayjs (package timex)github.com/sahilkhaire/gox/time

Now

Overview

Part of the time package — Node.js analog: moment, dayjs (package timex).

Signature

go
func Now() stdtime.Time

Compare: Node.js · Standard Go · gox

js
// Typical moment, dayjs (package timex) pattern in Node.js
go
t := time.Now()
t.Format(time.RFC3339)
go
import "github.com/sahilkhaire/gox/time"

now := timex.Now()

Example

go
import "github.com/sahilkhaire/gox/time"

now := timex.Now()

Tips

Import github.com/sahilkhaire/gox/time and call Now directly. See the comparison below for the standard library equivalent.

Standard library alternative

Use the standard library directly:

go
t := time.Now()
t.Format(time.RFC3339)

Back to time package overview

MIT Licensed · Built for Node.js developers moving to Go