144
144
var formatTests = []FormatTest{
145
{"ANSIC", ANSIC, "Thu Feb 4 21:00:57 2010"},
146
{"UnixDate", UnixDate, "Thu Feb 4 21:00:57 PST 2010"},
147
{"RubyDate", RubyDate, "Thu Feb 04 21:00:57 -0800 2010"},
148
{"RFC822", RFC822, "04 Feb 10 2100 PST"},
149
{"RFC850", RFC850, "Thursday, 04-Feb-10 21:00:57 PST"},
150
{"RFC1123", RFC1123, "Thu, 04 Feb 2010 21:00:57 PST"},
151
{"RFC3339", RFC3339, "2010-02-04T21:00:57-08:00"},
145
{"ANSIC", ANSIC, "Wed Feb 4 21:00:57 2009"},
146
{"UnixDate", UnixDate, "Wed Feb 4 21:00:57 PST 2009"},
147
{"RubyDate", RubyDate, "Wed Feb 04 21:00:57 -0800 2009"},
148
{"RFC822", RFC822, "04 Feb 09 2100 PST"},
149
{"RFC850", RFC850, "Wednesday, 04-Feb-09 21:00:57 PST"},
150
{"RFC1123", RFC1123, "Wed, 04 Feb 2009 21:00:57 PST"},
151
{"RFC3339", RFC3339, "2009-02-04T21:00:57-08:00"},
152
152
{"Kitchen", Kitchen, "9:00PM"},
153
153
{"am/pm", "3pm", "9pm"},
154
154
{"AM/PM", "3PM", "9PM"},
155
{"two-digit year", "06 01 02", "09 02 04"},
157
158
func TestFormat(t *testing.T) {
158
159
// The numeric time represents Thu Feb 4 21:00:57 PST 2010
159
time := SecondsToLocalTime(1265346057)
160
time := SecondsToLocalTime(1233810057)
160
161
for _, test := range formatTests {
161
162
result := time.Format(test.format)
162
163
if result != test.result {