Lines Matching defs:UTC
32 from datetime import UTC
72 self.assertIs(UTC, timezone.utc)
89 'tzinfo', 'UTC', 'sys'])
279 self.assertIsNot(timezone.utc, timezone(timedelta(0), 'UTC'))
280 self.assertEqual(timezone.utc, timezone(timedelta(0), 'UTC'))
317 self.assertEqual('UTC', timezone.utc.tzname(None))
318 self.assertEqual('UTC', UTC.tzname(None))
319 self.assertEqual('UTC', timezone(ZERO).tzname(None))
320 self.assertEqual('UTC-05:00', timezone(-5 * HOUR).tzname(None))
321 self.assertEqual('UTC+09:30', timezone(9.5 * HOUR).tzname(None))
322 self.assertEqual('UTC-00:01', timezone(timedelta(minutes=-1)).tzname(None))
328 self.assertEqual('UTC+01:06:40', timezone(timedelta(0, 4000)).tzname(None))
329 self.assertEqual('UTC-01:06:40',
331 self.assertEqual('UTC+01:06:40.000001',
333 self.assertEqual('UTC-01:06:40.000001',
2518 with self.subTest("minimum UTC"):
2526 with self.subTest("maximum UTC"):
2687 # Only local timezone and UTC are supported
2688 for tzseconds, tzname in ((0, 'UTC'), (0, 'GMT'),
2702 dtstr, fmt = "+1234 UTC", "%z %Z"
2705 self.assertEqual(dt.tzname(), 'UTC')
2710 self.assertEqual(strptime("UTC", "%Z").tzinfo, None)
2923 utc_ts = 1050323415.123456 # UTC timestamp
3100 UTC = timezone.utc
3186 self.theclass(2024, 12, 30, 3, 0, tzinfo=UTC)),
3188 self.theclass(2025, 1, 2, 3, 4, 5, tzinfo=UTC)),
3190 self.theclass(2025, 1, 2, 3, 4, 5, tzinfo=UTC)),
3192 self.theclass(2025, 1, 2, 3, 4, 5, 600000, tzinfo=UTC)),
3202 self.theclass(2025, 1, 2, 3, 4, 5, tzinfo=UTC)),
3222 self.theclass(2025, 1, 2, 3, 4, 5, 600000, tzinfo=UTC)),
3876 utc = FixedOffset(0, "UTC", -2)
3897 self.assertEqual(t2.tzname(), "UTC")
3940 self.assertEqual(t2.strftime("%H:%M:%S %Z %z"), "12:47:00 UTC +0000")
4357 # Smallest possible after UTC adjustment.
4359 # Largest possible after UTC adjustment.
4498 utc = FixedOffset(0, "UTC")
4510 self.assertEqual(t2.tzname(), "UTC")
4668 # In POSIX (epoch 1970), that's 2001-09-09 01:46:40 UTC, give or take.
4770 # is never in effect for a UTC time.
4800 # At the edges, UTC adjustment can produce years out-of-range
4896 expected = dt - dt.utcoffset() # in effect, convert to UTC
4905 @support.run_with_tz('UTC')
5098 utc_real = FixedOffset(0, "UTC", 0)
5099 # For better test coverage, we want another flavor of UTC that's west of
5120 # Conversion to UTC and back isn't always an identity here,
5122 # UTC time when DST begins: the clock jumps from 1:59:59
5127 # conversion back from UTC produces.
5130 # UTC gives the 1:MM:SS standard-time spelling.
5135 # They're the same times in UTC.
5149 # from UTC to mimic the local clock's "repeat an hour" behavior.
5169 # Converting to UTC and back is an identity too.
5225 # 22:00-0900 is 7:00 UTC == 2:00 EST == 3:00 DST. Since it's "after
5236 # Similar, but map to 6:00 UTC == 1:00 EST == 2:00 DST. In that
5247 # UTC 4:MM 5:MM 6:MM 7:MM checking these
5254 # Convert that to UTC.
5256 # Adjust for possibly fake UTC.
5258 # First UTC hour to convert; this is 4:00 when utc=utc_real &
5308 # Always converts UTC to standard time.
5314 # UTC 4:MM 5:MM 6:MM 7:MM 8:MM 9:MM
5442 "datetime in UTC -> datetime in local time."
5538 # Europe/Vilnius Mon Jun 23 20:59:59 1941 UTC = Mon Jun 23 23:59:59 1941 MSK isdst=0 gmtoff=10800
5539 # Europe/Vilnius Mon Jun 23 21:00:00 1941 UTC = Mon Jun 23 23:00:00 1941 CEST isdst=1 gmtoff=7200
5543 return [datetime(1941, 6, 23, 21, tzinfo=self), # Mon Jun 23 21:00:00 1941 UTC
5544 datetime(1941, 6, 23, 22, tzinfo=self)] # Mon Jun 23 22:00:00 1941 UTC
5623 'Mon Jun 23 19:59:59 1941 UTC')
5628 'Mon Jun 23 20:59:59 1941 UTC')
5633 'Mon Jun 23 21:59:59 1941 UTC')
5638 'Mon Jun 23 22:00:00 1941 UTC')
5944 """datetime in UTC -> datetime in local time."""
6223 # Iran had a sub-minute UTC offset before 1946.