Expectation:
All 6 (reflect.TypeOf) printed the same, but there are 4 different looking dates. I figured there would be at least 4 different types printed.
Question:
Is there another way or package that can clearly identify various Date/Time formatting from a String?
Other Thoughts:
Shouldn’t the type print as ‘String’ instead of ‘time.Time’
Hi, @Gabriel_Marquez, I’m getting different output for each line:
t Default Layout: 2009-11-10 23:00:00 +0000 UTC m=+0.000000001
time.Time
n Default Layout: 2020-02-10 09:10:10.01001001 +0000 UTC
time.Time
t US Layout: November 10, 2009
time.Time
n US Layout: February 10, 2020
time.Time
t ISO Layout: 2009-11-10
time.Time
n ISO Layout: 2020-02-10
time.Time
Program exited.
That’s because you’re writing: reflect.TypeOf(then).String(). reflect.TypeOf gets you a “type” object (like System.Type in .NET or java.lang.Class in Java (I think; I don’t really know Java)). Then you call String on that type object and get the name of the type.