lezhnev74 / go2strftime

Convert GO time format to strftime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This library converts default Go time format to strftime format.

layout := "Mon, 02 Jan 2006 15:04:05 -0700"
str2ftimeLayout, err := Go2Strftime(layout) // gives "%a, %d %b %Y %h:%M:%S %z"

As it seems the conversion cannot be correctly done as the features supported by both formats are not equal. For example strftime cannot represent nanoseconds, but go cannot represent week numbers.

The package just replaces supported segments with strftime and does no any error checking otherwise.

About

Convert GO time format to strftime

License:MIT License


Languages

Language:Go 100.0%