}
+func ExampleTime_GoString() {
+ t := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
+ fmt.Println(t.GoString())
+ t = t.Add(1 * time.Minute)
+ fmt.Println(t.GoString())
+ t = t.AddDate(0, 1, 0)
+ fmt.Println(t.GoString())
+ t, _ = time.Parse("Jan 2, 2006 at 3:04pm (MST)", "Feb 3, 2013 at 7:54pm (UTC)")
+ fmt.Println(t.GoString())
+
+ // Output:
+ // time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
+ // time.Date(2009, time.November, 10, 23, 1, 0, 0, time.UTC)
+ // time.Date(2009, time.December, 10, 23, 1, 0, 0, time.UTC)
+ // time.Date(2013, time.February, 3, 19, 54, 0, 0, time.UTC)
+}
+
func ExampleParse() {
// See the example for Time.Format for a thorough description of how
// to define the layout string to parse a time.Time value; Parse and
// 2012-07-09 00:00:00 +0200 CEST
}
+func ExampleUnix() {
+ unixTime := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
+ fmt.Println(unixTime.Unix())
+ t := time.Unix(unixTime.Unix(), 0).UTC()
+ fmt.Println(t)
+
+ // Output:
+ // 1257894000
+ // 2009-11-10 23:00:00 +0000 UTC
+}
+
+func ExampleUnixMicro() {
+ umt := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
+ fmt.Println(umt.UnixMicro())
+ t := time.UnixMicro(umt.UnixMicro()).UTC()
+ fmt.Println(t)
+
+ // Output:
+ // 1257894000000000
+ // 2009-11-10 23:00:00 +0000 UTC
+}
+
+func ExampleUnixMilli() {
+ umt := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
+ fmt.Println(umt.UnixMilli())
+ t := time.UnixMilli(umt.UnixMilli()).UTC()
+ fmt.Println(t)
+
+ // Output:
+ // 1257894000000
+ // 2009-11-10 23:00:00 +0000 UTC
+}
+
func ExampleTime_Unix() {
// 1 billion seconds of Unix, three ways.
fmt.Println(time.Unix(1e9, 0).UTC()) // 1e9 seconds