Categorygithub.com/syumai/go-dayjs
modulepackage
0.2.0
Repository: https://github.com/syumai/go-dayjs.git
Documentation: pkg.go.dev

# README

go-dayjs

  • go-dayjs is a wrapper of day.js running on QuickJS.
    • This package is using goja.

Installation

go get github.com/syumai/go-dayjs

Usage

{
  d, _ := dayjs.Parse("2021-01-02")
  result, _ := d.ToTime()
  fmt.Println(result) // 2021-01-02 00:00:00 +0900 JST
}

{
  d, _ := dayjs.ParseFormat("02-01-2020", "DD-MM-YYYY")
  result, _ := d.ToTime()
  fmt.Println(result) // 2021-01-02 00:00:00 +0900 JST
}

{
  now := time.Now()
  d, _ := dayjs.FromTime(now)
  result, _ := d.Format("YYYY-MM-DD HH:mm:ss")
  fmt.Println(result) // 2022-12-04 21:08:55
}

{
  now := time.Now()
  d, _ := dayjs.FromTime(now)
  result, _ := d.Format("X")
  fmt.Println(result) // 1670155735
}

License

MIT

Author

  • syumai
  • iamkun (original author of day.js)

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author