Hello All,
I am trying using time.Parse() to convert a time in string format back to the golang time format.
The time string is in the default golang format
"2006-01-02 15:04:05.999999999 -0700 MST"
I have to manually define the layout when calling time.Parse() because there is no constant predefined within the time library.
For example…
const longFormat = "2006-01-02 15:04:05.999999999 -0700 MST"
createTimeStamp, err := time.Parse(longFormat, timeStringIWishToParse)
Is there any plan to create this format as a constant? Otherwise, we will have to devise a pattern to define this format globally. I’d like to avoid doing this.
Here is what the documentation defines so far…
https://golang.org/pkg/time/#pkg-constants
Many Thanks!