Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strptime #22

Closed
iemttt opened this issue Aug 5, 2020 · 1 comment
Closed

strptime #22

iemttt opened this issue Aug 5, 2020 · 1 comment

Comments

@iemttt
Copy link

iemttt commented Aug 5, 2020

Is it possible to add strptime method or method that converts strftime format to go-like format?
Something like that:

func fromStrftime(s string) (layout string, err error) {
	xx, err := strftime.New(s)
	if err != nil {
		return
	}

	referenceTime, err := time.Parse(time.RFC3339Nano, "2006-01-02T15:04:05.999999999+07:00")
	if err != nil {
		panic(err)
	}

	layout = xx.FormatString(referenceTime)
	return
}
@lestrrat
Copy link
Collaborator

lestrrat commented Aug 6, 2020

Thanks for the suggestion, but no, not in this library. I mean, it's called strftime for a reason :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants