Now
Overview
Part of the time package — Node.js analog: moment, dayjs (package timex).
Signature
go
func Now() stdtime.TimeCompare: Node.js · Standard Go · gox
js
// Typical moment, dayjs (package timex) pattern in Node.jsgo
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)