fefit / dateutil

An implementation of PHP methods 'strtotime'(not include the relative formats now), 'date_format' in golang.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dateutil

Build Status codecov

An implementation of PHP methods 'strtotime'(not include the relative formats now), 'date_format' in golang.

Usage

import (
  "fmt"
  du "github.com/fefit/dateutil"
)
func main(){
   if date, err := du.DateTime("Sep-05-2021 06:07:06pm"); err == nil{
     formatted, _ := du.DateFormat(date, "Y-m-d H:i:s")
     fmt.Printf("%s", formatted) // Output: 2021-09-05 18:07:06
   }
}

License

MIT License.

About

An implementation of PHP methods 'strtotime'(not include the relative formats now), 'date_format' in golang.

License:MIT License


Languages

Language:Go 99.4%Language:Shell 0.6%