Home | History | Annotate | Download | only in base

Lines Matching full:time

5 #include <time.h>
8 #include "base/time.h"
11 using base::Time;
16 PRTime comparison_time_pdt = 1192477500 * Time::kMicrosecondsPerSecond;
18 // Specialized test fixture allowing time strings without timezones to be
19 // tested by comparing them to a known time in the local zone.
25 // must be a time guaranteed to be outside of a DST fallback hour in
39 Time::kMicrosecondsPerSecond;
47 // a variety of time strings.
50 time(&current_time);
135 // This tests the Time::FromString wrapper over PR_ParseTimeString
137 Time parsed_time;
138 bool result = Time::FromString(L"15/10/07 12:45", &parsed_time);
143 Time::kMicrosecondsPerSecond;
147 // This tests the Time::FromString wrapper over PR_ParseTimeString
149 Time parsed_time;
150 bool result = Time::FromString(L"Mon, 15 Oct 2007 19:45:00 GMT",
155 time_t time_to_compare = comparison_time_pdt / Time::kMicrosecondsPerSecond;
161 Time parsed_time;
164 EXPECT_TRUE(Time::FromString(L"Thu Jan 01 01:00:00 +0100 1970",
167 EXPECT_TRUE(Time::FromString(L"Thu Jan 01 00:00:00 GMT 1970",
173 Time parsed_time;
176 EXPECT_TRUE(Time::FromString(L"Thu Jan 01 01:00:01 +0100 1970",
179 EXPECT_TRUE(Time::FromString(L"Thu Jan 01 00:00:01 GMT 1970",
185 Time parsed_time;
188 EXPECT_TRUE(Time::FromString(L"Thu Jan 01 01:00:02 +0100 1970",
191 EXPECT_TRUE(Time::FromString(L"Thu Jan 01 00:00:02 GMT 1970",
197 Time parsed_time;
200 EXPECT_TRUE(Time::FromString(L"Thu Jan 01 00:59:59 +0100 1970",
203 EXPECT_TRUE(Time::FromString(L"Wed Dec 31 23:59:59 GMT 1969",
209 // cause timegm() to return -1. The parsed time should not be 1 second
212 Time parsed_time;
214 EXPECT_TRUE(Time::FromString(L"Wed Dec 31 23:59:59 GMT 2100",
220 Time parsed_time;
223 EXPECT_TRUE(Time::FromString(L"Thu Jan 01 00:59:58 +0100 1970",
226 EXPECT_TRUE(Time::FromString(L"Wed Dec 31 23:59:58 GMT 1969",
232 Time parsed_time;
235 EXPECT_TRUE(Time::FromString(L"Wed Jun 29 19:40:01 +0100 1960",
238 EXPECT_TRUE(Time::FromString(L"Wed Jun 29 18:40:01 GMT 1960",
241 EXPECT_TRUE(Time::FromString(L"Wed Jun 29 17:40:01 GMT 1960",
247 Time parsed_time;
248 EXPECT_FALSE(Time::FromString(L"", &parsed_time));
255 // Note the lack of timezone in the time string. The year has to be 3001.
256 // The date has to be after 23:59:59, December 31, 3000, US Pacific Time, so