Home
last modified time | relevance | path

Searched refs:datetime (Results 1 – 25 of 838) sorted by relevance

12345678910>>...34

/external/python/dateutil/docs/
Drrule.rst30 from datetime import *
39 >>> from datetime import *
52 [datetime.datetime(1997, 9, 2, 9, 0),
53 datetime.datetime(1997, 9, 3, 9, 0),
54 datetime.datetime(1997, 9, 4, 9, 0),
55 datetime.datetime(1997, 9, 5, 9, 0),
56 datetime.datetime(1997, 9, 6, 9, 0),
57 datetime.datetime(1997, 9, 7, 9, 0),
58 datetime.datetime(1997, 9, 8, 9, 0),
59 datetime.datetime(1997, 9, 9, 9, 0),
[all …]
Dexamples.rst11 from datetime import *; from dateutil.relativedelta import *
13 NOW = datetime(2003, 9, 17, 20, 54, 47, 282310)
18 >>> from datetime import *; from dateutil.relativedelta import *
23 >>> NOW = datetime.now()
26 datetime.datetime(2003, 9, 17, 20, 54, 47, 282310)
28 datetime.date(2003, 9, 17)
35 datetime.datetime(2003, 10, 17, 20, 54, 47, 282310)
42 datetime.datetime(2003, 10, 24, 20, 54, 47, 282310)
49 datetime.datetime(2003, 10, 24, 10, 0)
53 original datetime rather than performing an arithmetic operation on them.
[all …]
Drelativedelta.rst13 >>> from datetime import *; from dateutil.relativedelta import *
15 >>> NOW = datetime(2003, 9, 17, 20, 54, 47, 282310)
20 >>> from datetime import *; from dateutil.relativedelta import *
25 >>> NOW = datetime.now()
28 datetime.datetime(2003, 9, 17, 20, 54, 47, 282310)
30 datetime.date(2003, 9, 17)
37 datetime.datetime(2003, 10, 17, 20, 54, 47, 282310)
44 datetime.datetime(2003, 10, 24, 20, 54, 47, 282310)
51 datetime.datetime(2003, 10, 24, 10, 0)
55 original datetime rather than performing an arithmetic operation on them.
[all …]
/external/python/dateutil/dateutil/test/
Dtest_rrule.py5 from datetime import datetime, date
40 dtstart=datetime(1997, 9, 2, 9, 0))),
52 dtstart=datetime(1997, 9, 2, 9, 0))),
53 [datetime(1997, 9, 2, 9, 0),
54 datetime(1998, 9, 2, 9, 0),
55 datetime(1999, 9, 2, 9, 0)])
61 dtstart=datetime(1997, 9, 2, 9, 0))),
62 [datetime(1997, 9, 2, 9, 0),
63 datetime(1999, 9, 2, 9, 0),
64 datetime(2001, 9, 2, 9, 0)])
[all …]
Dtest_parser.py5 from datetime import datetime, timedelta
25 datetime.now().strftime('%-d')
32 ("Thu Sep 25 10:36:28 2003", datetime(2003, 9, 25, 10, 36, 28), "date command format strip"),
33 ("Thu Sep 25 2003", datetime(2003, 9, 25), "date command format strip"),
34 ("2003-09-25T10:49:41", datetime(2003, 9, 25, 10, 49, 41), "iso format strip"),
35 ("2003-09-25T10:49", datetime(2003, 9, 25, 10, 49), "iso format strip"),
36 ("2003-09-25T10", datetime(2003, 9, 25, 10), "iso format strip"),
37 ("2003-09-25", datetime(2003, 9, 25), "iso format strip"),
38 ("20030925T104941", datetime(2003, 9, 25, 10, 49, 41), "iso stripped format strip"),
39 ("20030925T1049", datetime(2003, 9, 25, 10, 49, 0), "iso stripped format strip"),
[all …]
Dtest_isoparser.py4 from datetime import datetime, timedelta, date, time
48 DATES = [datetime(1996, 1, 1), datetime(2017, 1, 1)]
55 DATES += [datetime(2000, 2, 1), datetime(2017, 4, 1)]
63 DATES += [datetime(2016, 2, 29), datetime(2018, 3, 15)]
92 DATETIMES = [datetime(1998, 4, 16, 12),
93 datetime(2019, 11, 18, 23),
94 datetime(2014, 12, 16, 4)]
101 DATETIMES = [datetime(2012, 1, 6, 9, 37)]
109 DATETIMES = [datetime(2003, 9, 2, 22, 14, 2),
110 datetime(2003, 8, 8, 14, 9, 14),
[all …]
Dtest_relativedelta.py6 from datetime import datetime, date, timedelta
13 now = datetime(2003, 9, 17, 20, 54, 47, 282310)
43 self.assertEqual(relativedelta(datetime(2003, 1, 31, 23, 59, 59),
44 datetime(2003, 3, 1, 0, 0, 0)),
47 self.assertEqual(relativedelta(datetime(2003, 3, 1, 0, 0, 0),
48 datetime(2003, 1, 31, 23, 59, 59)),
52 self.assertEqual(relativedelta(datetime(2012, 1, 31, 23, 59, 59),
53 datetime(2012, 3, 1, 0, 0, 0)),
56 self.assertEqual(relativedelta(datetime(2003, 3, 1, 0, 0, 0),
57 datetime(2003, 1, 31, 23, 59, 59)),
[all …]
Dtest_tz.py8 from datetime import datetime, timedelta
9 from datetime import time as dt_time
10 from datetime import tzinfo
201 t0_u = datetime(2012, 3, 31, 15, 30, tzinfo=tz.tzutc()) # AEST
202 t1_u = datetime(2012, 3, 31, 16, 30, tzinfo=tz.tzutc()) # AEDT
208 datetime(2012, 4, 1, 2, 30))
211 datetime(2012, 4, 1, 2, 30))
223 t0_u = datetime(2012, 10, 6, 15, 30, tzinfo=tz.tzutc()) # AEST
224 t1_u = datetime(2012, 10, 6, 16, 30, tzinfo=tz.tzutc()) # AEDT
230 datetime(2012, 10, 7, 1, 30))
[all …]
Dtest_utils.py3 from datetime import timedelta, datetime
18 @freeze_time(datetime(2014, 12, 15, 1, 21, 33, 4003))
20 self.assertEqual(utils.today(), datetime(2014, 12, 15, 0, 0, 0))
22 @freeze_time(datetime(2014, 12, 15, 12), tz_offset=5)
25 datetime(2014, 12, 15, 0, 0, 0, tzinfo=NYC))
27 @freeze_time(datetime(2014, 12, 15, 23), tz_offset=5)
30 datetime(2014, 12, 16, 0, 0, 0, tzinfo=UTC))
33 dt = datetime(2014, 9, 14, 9, 30)
38 dt = datetime(2014, 9, 14, 9, 30, tzinfo=UTC)
43 d1 = datetime(2016, 1, 1, 12, 14, 1, 9)
[all …]
/external/marisa-trie/bindings/python/
Dbenchmark.py1 import datetime
5 time_begin = datetime.datetime.now()
9 time_end = datetime.datetime.now()
12 time_begin = datetime.datetime.now()
16 time_end = datetime.datetime.now()
19 time_begin = datetime.datetime.now()
22 time_end = datetime.datetime.now()
25 time_begin = datetime.datetime.now()
29 time_end = datetime.datetime.now()
32 time_begin = datetime.datetime.now()
[all …]
/external/python/pybind11/tests/
Dtest_chrono.py3 import datetime
12 date0 = datetime.datetime.today()
14 date2 = datetime.datetime.today()
17 assert isinstance(date1, datetime.datetime)
32 date1 = datetime.datetime.today()
38 assert isinstance(date2, datetime.datetime)
48 date1 = datetime.date.today()
56 assert isinstance(datetime2, datetime.datetime)
57 assert isinstance(date2, datetime.date)
58 assert isinstance(time2, datetime.time)
[all …]
/external/python/python-api-core/tests/unit/
Dtest_datetime_helpers.py16 import datetime
29 assert isinstance(result, datetime.datetime)
33 dt = datetime.datetime(1970, 1, 1, 0, 0, 1, tzinfo=datetime.timezone.utc)
39 dt = datetime.datetime(1970, 1, 1, 0, 0, 0, microsecond=microseconds)
44 zone = datetime.timezone(datetime.timedelta(minutes=-1))
45 dt = datetime.datetime(1970, 1, 1, 0, 0, 0, tzinfo=zone)
51 dt = datetime.datetime(1970, 1, 1, 0, 0, 0, microsecond=microseconds, tzinfo=None)
57 five_mins_from_epoch_datetime = datetime.datetime(
58 1970, 1, 1, 0, 5, 0, tzinfo=datetime.timezone.utc
67 today = datetime.date.today()
[all …]
/external/python/pyasn1/tests/type/
Dtest_useful.py7 import datetime
23 class FixedOffset(datetime.tzinfo):
25 self.__offset = datetime.timedelta(minutes=offset)
35 return datetime.timedelta(0)
49 …assert useful.GeneralizedTime.fromDateTime(datetime.datetime(2017, 7, 11, 0, 1, 2, 3000, tzinfo=UT…
52 …assert datetime.datetime(2017, 7, 11, 0, 1, 2) == useful.GeneralizedTime('20170711000102').asDateT…
55 …assert datetime.datetime(2017, 7, 11, 0, 1, 2, tzinfo=UTC) == useful.GeneralizedTime('201707110001…
58 …assert datetime.datetime(2017, 7, 11, 0, 1, 2, 3000, tzinfo=UTC) == useful.GeneralizedTime('201707…
61 …assert datetime.datetime(2017, 7, 11, 0, 1, 2, 3000, tzinfo=UTC) == useful.GeneralizedTime('201707…
64 …assert datetime.datetime(2017, 7, 11, 0, 1, 2, 3000, tzinfo=UTC) == useful.GeneralizedTime('201707…
[all …]
/external/python/cryptography/tests/x509/
Dtest_x509_crlbuilder.py7 import datetime
52 last_time = datetime.datetime(2012, 1, 16, 22, 43)
55 utc_last = datetime.datetime(2012, 1, 17, 6, 43)
56 next_time = datetime.datetime(2022, 1, 17, 6, 43)
84 builder.last_update(datetime.datetime(1940, 8, 10))
88 datetime.datetime(2002, 1, 1, 12, 1)
91 builder.last_update(datetime.datetime(2002, 1, 1, 12, 1))
96 next_time = datetime.datetime(2022, 1, 16, 22, 43)
99 utc_next = datetime.datetime(2022, 1, 17, 6, 43)
100 last_time = datetime.datetime(2012, 1, 17, 6, 43)
[all …]
Dtest_x509_revokedcertbuilder.py7 import datetime
32 revocation_date = datetime.datetime(2002, 1, 1, 12, 1)
44 revocation_date = datetime.datetime(2002, 1, 1, 12, 1)
65 time = datetime.datetime(2012, 1, 16, 22, 43)
68 utc_time = datetime.datetime(2012, 1, 17, 6, 43)
86 datetime.datetime(1940, 8, 10)
91 datetime.datetime(2002, 1, 1, 12, 1)
94 builder.revocation_date(datetime.datetime(2002, 1, 1, 12, 1))
115 datetime.datetime(2002, 1, 1, 12, 1)
131 revocation_date = datetime.datetime(2002, 1, 1, 12, 1)
[all …]
/external/python/dateutil/docs/exercises/solutions/
Dmlk_day_rrule_solution.py3 from datetime import datetime
6 dtstart=datetime(1986, 1, 20), # First celebration
14 from datetime import datetime
17 ((datetime(1970, 1, 1), datetime(1980, 1, 1)),
19 ((datetime(1980, 1, 1), datetime(1989, 1, 1)),
20 [datetime(1986, 1, 20),
21 datetime(1987, 1, 19),
22 datetime(1988, 1, 18)]),
23 ((datetime(2017, 2, 1), datetime(2022, 2, 1)),
24 [datetime(2018, 1, 15, 0, 0),
[all …]
/external/python/cpython3/Lib/test/test_email/
Dtest_utils.py1 import datetime
14 utcoffset = datetime.timedelta(hours=-7)
15 tz = datetime.timezone(utcoffset)
16 naive_dt = datetime.datetime(*dateargs)
17 aware_dt = datetime.datetime(*dateargs, tzinfo=tz)
28 utc_dt = datetime.datetime(*self.dateargs,
29 tzinfo=datetime.timezone.utc)
76 t0 = datetime.datetime(2012, 3, 12, 1, 1)
83 t0 = datetime.datetime(2012, 3, 12, 1, 1)
91 t0 = datetime.datetime(2012, 3, 12, 1, 1)
[all …]
/external/python/cpython3/Lib/test/test_zoneinfo/
Dtest_zoneinfo.py17 from datetime import date, datetime, time, timedelta, timezone
95 class DatetimeSubclass(datetime):
258 (datetime(2019, 1, 1, tzinfo=timezone.utc), ValueError),
259 (datetime(2019, 1, 1), ValueError),
273 dt = datetime(2020, 1, 1, tzinfo=zi)
499 epoch = datetime(1970, 1, 1)
552 ZoneTransition(datetime(1883, 6, 9, 14), LMT, STD),
560 dt0 = datetime(1883, 6, 9, 1, tzinfo=zi)
561 dt1 = datetime(1883, 6, 10, 1, tzinfo=zi)
571 datetime(1883, 6, 9, 1, tzinfo=zi),
[all …]
/external/python/python-api-core/google/api_core/
Ddatetime_helpers.py18 import datetime
24 _UTC_EPOCH = datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc)
45 return datetime.datetime.utcnow()
71 return _UTC_EPOCH + datetime.timedelta(microseconds=value)
84 value = value.replace(tzinfo=datetime.timezone.utc)
86 value = value.astimezone(datetime.timezone.utc)
100 return datetime.datetime.strptime(value, "%Y-%m-%d").date()
112 return datetime.datetime.strptime(value, "%H:%M:%S").time()
145 bare_seconds = datetime.datetime.strptime(
157 return bare_seconds.replace(microsecond=micros, tzinfo=datetime.timezone.utc)
[all …]
/external/python/pyyaml/tests/data/
Dtimestamp-bugs.code2 [datetime.datetime(2001, 12, 15, 3, 29, 43, 100000), 'UTC-05:30'],
3 [datetime.datetime(2001, 12, 14, 16, 29, 43, 100000), 'UTC+05:30'],
4 [datetime.datetime(2001, 12, 14, 21, 59, 43, 1010), None],
5 [datetime.datetime(2001, 12, 14, 21, 59, 43, 0, FixedOffset(60, "+1")), 'UTC+01:00'],
6 [datetime.datetime(2001, 12, 14, 21, 59, 43, 0, FixedOffset(-90, "-1:30")), 'UTC-01:30'],
7 [datetime.datetime(2005, 7, 8, 17, 35, 4, 517600), None],
Dconstruct-timestamp.code2 "canonical": datetime.datetime(2001, 12, 15, 2, 59, 43, 100000),
3 "valid iso8601": datetime.datetime(2001, 12, 15, 2, 59, 43, 100000),
4 "space separated": datetime.datetime(2001, 12, 15, 2, 59, 43, 100000),
5 "no time zone (Z)": datetime.datetime(2001, 12, 15, 2, 59, 43, 100000),
6 "date (00:00:00Z)": datetime.date(2002, 12, 14),
/external/python/dateutil/docs/exercises/
Dindex.rst42 from datetime import datetime
44 ((datetime(1970, 1, 1), datetime(1980, 1, 1)),
46 ((datetime(1980, 1, 1), datetime(1989, 1, 1)),
47 [datetime(1986, 1, 20),
48 datetime(1987, 1, 19),
49 datetime(1988, 1, 18)]),
50 ((datetime(2017, 2, 1), datetime(2022, 2, 1)),
51 [datetime(2018, 1, 15, 0, 0),
52 datetime(2019, 1, 21, 0, 0),
53 datetime(2020, 1, 20, 0, 0),
[all …]
/external/libtextclassifier/native/annotator/datetime/
Ddatetime-grounder_test.cc25 using ::libtextclassifier3::grammar::datetime::AbsoluteDateTimeT;
26 using ::libtextclassifier3::grammar::datetime::ComponentType;
27 using ::libtextclassifier3::grammar::datetime::Meridiem;
28 using ::libtextclassifier3::grammar::datetime::RelativeDatetimeComponentT;
29 using ::libtextclassifier3::grammar::datetime::RelativeDateTimeT;
30 using ::libtextclassifier3::grammar::datetime::TimeZoneT;
31 using ::libtextclassifier3::grammar::datetime::UngroundedDatetime;
32 using ::libtextclassifier3::grammar::datetime::UngroundedDatetimeT;
33 using ::libtextclassifier3::grammar::datetime::RelativeDatetimeComponent_::
50 grammar::datetime::UngroundedDatetimeT ungrounded_datetime; in BuildAbsoluteDatetime()
[all …]
Ddatetime-grounder.cc31 using ::libtextclassifier3::grammar::datetime::AbsoluteDateTime;
32 using ::libtextclassifier3::grammar::datetime::ComponentType;
33 using ::libtextclassifier3::grammar::datetime::Meridiem;
34 using ::libtextclassifier3::grammar::datetime::RelativeDateTime;
35 using ::libtextclassifier3::grammar::datetime::RelativeDatetimeComponent;
36 using ::libtextclassifier3::grammar::datetime::UngroundedDatetime;
37 using ::libtextclassifier3::grammar::datetime::RelativeDatetimeComponent_::
115 const grammar::datetime::ComponentType component_type) { in ToComponentType()
117 case grammar::datetime::ComponentType_YEAR: in ToComponentType()
119 case grammar::datetime::ComponentType_MONTH: in ToComponentType()
[all …]
/external/rust/crates/der/src/asn1/
Dutc_time.rs5 datetime::{self, DateTime},
41 pub fn from_date_time(datetime: DateTime) -> Result<Self> { in from_date_time()
42 if datetime.year() <= MAX_YEAR { in from_date_time()
43 Ok(Self(datetime)) in from_date_time()
94 let year = u16::from(datetime::decode_decimal(Self::TAG, year1, year2)?); in decode_value()
95 let month = datetime::decode_decimal(Self::TAG, mon1, mon2)?; in decode_value()
96 let day = datetime::decode_decimal(Self::TAG, day1, day2)?; in decode_value()
97 let hour = datetime::decode_decimal(Self::TAG, hour1, hour2)?; in decode_value()
98 let minute = datetime::decode_decimal(Self::TAG, min1, min2)?; in decode_value()
99 let second = datetime::decode_decimal(Self::TAG, sec1, sec2)?; in decode_value()
[all …]

12345678910>>...34