Home
last modified time | relevance | path

Searched refs:Utc (Results 1 – 25 of 27) sorted by relevance

12

/external/rust/crates/chrono/src/offset/
Dutc.rs36 pub struct Utc; struct
39 impl Utc { impl
41 pub fn today() -> Date<Utc> { in today()
42 Utc::now().date() in today()
47 pub fn now() -> DateTime<Utc> { in now()
51 DateTime::from_utc(naive, Utc) in now()
56 pub fn now() -> DateTime<Utc> { in now()
58 DateTime::<Utc>::from(now) in now()
62 impl TimeZone for Utc { implementation
63 type Offset = Utc;
[all …]
Dmod.rs472 pub use self::utc::Utc;
480 let dt = Utc.timestamp_millis(-1000); in test_negative_millis()
482 let dt = Utc.timestamp_millis(-7000); in test_negative_millis()
484 let dt = Utc.timestamp_millis(-7001); in test_negative_millis()
486 let dt = Utc.timestamp_millis(-7003); in test_negative_millis()
488 let dt = Utc.timestamp_millis(-999); in test_negative_millis()
490 let dt = Utc.timestamp_millis(-1); in test_negative_millis()
492 let dt = Utc.timestamp_millis(-60000); in test_negative_millis()
494 let dt = Utc.timestamp_millis(-3600000); in test_negative_millis()
502 match Utc.timestamp_millis_opt(*millis) { in test_negative_millis()
[all …]
Dlocal.rs108 use super::Utc; in now()
109 let now: DateTime<Utc> = super::Utc::now(); in now()
/external/rust/crates/chrono/src/
Ddatetime.rs29 use offset::{FixedOffset, Offset, TimeZone, Utc};
76 pub const MIN_DATETIME: DateTime<Utc> = DateTime { datetime: naive::MIN_DATETIME, offset: Utc };
78 pub const MAX_DATETIME: DateTime<Utc> = DateTime { datetime: naive::MAX_DATETIME, offset: Utc };
257 impl From<DateTime<Utc>> for DateTime<FixedOffset> {
262 fn from(src: DateTime<Utc>) -> Self { in from()
269 impl From<DateTime<Utc>> for DateTime<Local> {
273 fn from(src: DateTime<Utc>) -> Self { in from()
279 impl From<DateTime<FixedOffset>> for DateTime<Utc> {
285 src.with_timezone(&Utc) in from()
303 impl From<DateTime<Local>> for DateTime<Utc> {
[all …]
Dround.rs271 use offset::{FixedOffset, TimeZone, Utc};
293 let dt = Utc.ymd(2018, 1, 11).and_hms_nano(10, 5, 27, 750_500_000); in test_round_subsecs()
306 let dt = Utc.ymd(2016, 12, 31).and_hms_nano(23, 59, 59, 1_750_500_000); in test_round_leap_nanos()
349 let dt = Utc.ymd(2016, 12, 31).and_hms_nano(23, 59, 59, 1_750_500_000); in test_trunc_leap_nanos()
362 let dt = Utc.ymd(2016, 12, 31).and_hms_nano(23, 59, 59, 175_500_000); in test_duration_round()
370 let dt = Utc.ymd(2012, 12, 12).and_hms_milli(18, 22, 30, 0); in test_duration_round()
376 let dt = Utc.ymd(2012, 12, 12).and_hms_milli(18, 22, 29, 999); in test_duration_round()
402 let dt = Utc.ymd(1969, 12, 12).and_hms(12, 12, 12); in test_duration_round_pre_epoch()
411 let dt = Utc.ymd(2016, 12, 31).and_hms_nano(23, 59, 59, 1_75_500_000); in test_duration_trunc()
419 let dt = Utc.ymd(2012, 12, 12).and_hms_milli(18, 22, 30, 0); in test_duration_trunc()
[all …]
Ddate.rs18 use offset::{TimeZone, Utc};
53 pub const MIN_DATE: Date<Utc> = Date { date: naive::MIN_DATE, offset: Utc };
55 pub const MAX_DATE: Date<Utc> = Date { date: naive::MAX_DATE, offset: Utc };
Dlib.rs502 pub use offset::{FixedOffset, LocalResult, Offset, TimeZone, Utc};
522 pub use {FixedOffset, Utc};
1468 let date = Utc.ymd(2019, 10, 28).and_hms(9, 10, 11); in test_month_enum_primitive_parse()
1472 let dt = Utc.ymd(2019, month.number_from_month(), 28).and_hms(9, 10, 11); in test_month_enum_primitive_parse()
/external/grpc-grpc/src/csharp/Grpc.Core.Tests/Internal/
DTimespecTest.cs32 Assert.AreEqual(DateTimeKind.Utc, Timespec.Now.ToDateTime().Kind); in Now_IsInUtc()
72 Assert.AreEqual(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc), in ToDateTime()
75 Assert.AreEqual(new DateTime(1970, 1, 1, 0, 0, 10, DateTimeKind.Utc).AddTicks(50), in ToDateTime()
78 Assert.AreEqual(new DateTime(2015, 7, 21, 4, 21, 48, DateTimeKind.Utc), in ToDateTime()
82 Assert.AreEqual(new DateTime(1969, 12, 31, 23, 59, 55, DateTimeKind.Utc).AddTicks(10), in ToDateTime()
90 Assert.AreEqual(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddTicks(1), in ToDateTime()
105 Assert.AreEqual(DateTimeKind.Utc, new Timespec(1437452508, 0).ToDateTime().Kind); in ToDateTime_ReturnsUtc()
137 Timespec.FromDateTime(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc))); in FromDateTime()
140 … Timespec.FromDateTime(new DateTime(1970, 1, 1, 0, 0, 10, DateTimeKind.Utc).AddTicks(50))); in FromDateTime()
143 Timespec.FromDateTime(new DateTime(2015, 7, 21, 4, 21, 48, DateTimeKind.Utc))); in FromDateTime()
[all …]
/external/rust/crates/plotters/examples/
Dslc-temp.rs3 use chrono::{TimeZone, Utc};
23 (Utc.ymd(2010, 1, 1)..Utc.ymd(2018, 12, 1)).monthly(), in main()
27 (Utc.ymd(2010, 1, 1)..Utc.ymd(2018, 12, 1)).monthly(), in main()
44 DATA.iter().map(|(y, m, t)| (Utc.ymd(*y, *m, 1), *t)), in main()
50 .map(|(y, m, t)| Circle::new((Utc.ymd(*y, *m, 1), *t), 3, BLUE.filled())), in main()
/external/protobuf/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/
DTimestampTest.cs43 DateTime utcMin = DateTime.SpecifyKind(DateTime.MinValue, DateTimeKind.Utc); in FromAndToDateTime()
44 DateTime utcMax = DateTime.SpecifyKind(DateTime.MaxValue, DateTimeKind.Utc); in FromAndToDateTime()
47 AssertRoundtrip(new Timestamp(), new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)); in FromAndToDateTime()
48 …oundtrip(new Timestamp { Nanos = 1000000}, new DateTime(1970, 1, 1, 0, 0, 0, 1, DateTimeKind.Utc)); in FromAndToDateTime()
49 … Seconds = -1, Nanos = 999000000 }, new DateTime(1969, 12, 31, 23, 59, 59, 999, DateTimeKind.Utc)); in FromAndToDateTime()
50 …rtRoundtrip(new Timestamp { Seconds = 3600 }, new DateTime(1970, 1, 1, 1, 0, 0, DateTimeKind.Utc)); in FromAndToDateTime()
51 …undtrip(new Timestamp { Seconds = -3600 }, new DateTime(1969, 12, 31, 23, 0, 0, DateTimeKind.Utc)); in FromAndToDateTime()
58 …Assert.AreEqual(new DateTime(1970, 1, 1, 0, 0, 1, DateTimeKind.Utc).AddMilliseconds(1), t1.ToDateT… in ToDateTimeTruncation()
91 Assert.AreEqual(DateTimeKind.Utc, timestamp.ToDateTime().Kind); in AssertRoundtrip()
/external/rust/crates/rusqlite/src/types/
Dchrono.rs5 use chrono::{DateTime, Local, NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc};
88 Ok(ToSqlOutput::from(self.with_timezone(&Utc).to_rfc3339())) in to_sql()
93 impl FromSql for DateTime<Utc> {
112 return Ok(dt.with_timezone(&Utc)); in column_result()
117 NaiveDateTime::column_result(value).map(|dt| Utc.from_utc_datetime(&dt)) in column_result()
124 let utc_dt = DateTime::<Utc>::column_result(value)?; in column_result()
132 use chrono::{DateTime, Duration, Local, NaiveDate, NaiveDateTime, NaiveTime, TimeZone, Utc};
208 let utc = Utc.from_utc_datetime(&dt); in test_date_time_utc()
218 let v1: DateTime<Utc> = db in test_date_time_utc()
223 let v2: DateTime<Utc> = db in test_date_time_utc()
[all …]
/external/rust/crates/chrono/
DREADME.md123 * [**`Utc`**](https://docs.rs/chrono/0.4/chrono/offset/struct.Utc.html) specifies the UTC time zone…
138 ([`Utc::now()`](https://docs.rs/chrono/0.4/chrono/offset/struct.Utc.html#method.now))
145 let utc: DateTime<Utc> = Utc::now(); // e.g. `2014-11-28T12:45:59.324310806Z`
157 let dt = Utc.ymd(2014, 7, 8).and_hms(9, 10, 11); // `2014-07-08T09:10:11Z`
159 assert_eq!(dt, Utc.yo(2014, 189).and_hms(9, 10, 11));
161 assert_eq!(dt, Utc.isoywd(2014, 28, Weekday::Tue).and_hms(9, 10, 11));
163 let dt = Utc.ymd(2014, 7, 8).and_hms_milli(9, 10, 11, 12); // `2014-07-08T09:10:11.012Z`
164 assert_eq!(dt, Utc.ymd(2014, 7, 8).and_hms_micro(9, 10, 11, 12_000));
165 assert_eq!(dt, Utc.ymd(2014, 7, 8).and_hms_nano(9, 10, 11, 12_000_000));
168 assert_eq!(Utc.ymd_opt(2014, 7, 8).and_hms_opt(21, 15, 33),
[all …]
DCHANGELOG.md60 * Added MIN and MAX values for `NaiveTime`, `NaiveDateTime` and `DateTime<Utc>`.
100 `dt.to_string().parse::<DateTime<Utc>>()` now correctly works on round-trip.
278 the forward direction is limited to `DateTime<Utc>` and `DateTime<Local>` only.
283 and `UTC` has been renamed to `Utc` in accordance with the current convention (#148).
298 `chrono::offset::utc::UTC` | `chrono::offset::Utc`
303 With an exception of `Utc`, this change does not affect any direct usage of
/external/rust/crates/plotters/src/coord/ranged1d/types/
Ddatetime.rs841 use chrono::{TimeZone, Utc};
845 let range = Utc.ymd(1000, 1, 1)..Utc.ymd(2999, 1, 1); in test_date_range_long()
849 assert_eq!(ranged_coord.map(&Utc.ymd(1000, 8, 10), (0, 100)), 0); in test_date_range_long()
850 assert_eq!(ranged_coord.map(&Utc.ymd(2999, 8, 10), (0, 100)), 100); in test_date_range_long()
873 let range = Utc.ymd(2019, 1, 1)..Utc.ymd(2019, 1, 21); in test_date_range_short()
916 let range = Utc.ymd(1000, 8, 5)..Utc.ymd(2999, 1, 1); in test_yearly_date_range()
919 assert_eq!(ranged_coord.map(&Utc.ymd(1000, 8, 10), (0, 100)), 0); in test_yearly_date_range()
920 assert_eq!(ranged_coord.map(&Utc.ymd(2999, 8, 10), (0, 100)), 100); in test_yearly_date_range()
941 let range = Utc.ymd(2019, 8, 5)..Utc.ymd(2020, 1, 1); in test_yearly_date_range()
949 let range = Utc.ymd(2019, 8, 5)..Utc.ymd(2020, 9, 1); in test_monthly_date_range()
[all …]
/external/rust/crates/chrono/tests/
Dwasm.rs11 let utc: DateTime<Utc> = Utc::now(); in now()
16 let actual = Utc.datetime_from_str(&now, "%s").unwrap(); in now()
52 let dt = DateTime::<Utc>::from(now.clone()); in from_is_exact()
/external/protobuf/csharp/src/Google.Protobuf.Test/WellKnownTypes/
DTimestampTest.cs43 DateTime utcMin = DateTime.SpecifyKind(DateTime.MinValue, DateTimeKind.Utc); in FromAndToDateTime()
44 DateTime utcMax = DateTime.SpecifyKind(DateTime.MaxValue, DateTimeKind.Utc); in FromAndToDateTime()
47 AssertRoundtrip(new Timestamp(), new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)); in FromAndToDateTime()
48 …oundtrip(new Timestamp { Nanos = 1000000}, new DateTime(1970, 1, 1, 0, 0, 0, 1, DateTimeKind.Utc)); in FromAndToDateTime()
49 … Seconds = -1, Nanos = 999000000 }, new DateTime(1969, 12, 31, 23, 59, 59, 999, DateTimeKind.Utc)); in FromAndToDateTime()
50 …rtRoundtrip(new Timestamp { Seconds = 3600 }, new DateTime(1970, 1, 1, 1, 0, 0, DateTimeKind.Utc)); in FromAndToDateTime()
51 …undtrip(new Timestamp { Seconds = -3600 }, new DateTime(1969, 12, 31, 23, 0, 0, DateTimeKind.Utc)); in FromAndToDateTime()
58 …Assert.AreEqual(new DateTime(1970, 1, 1, 0, 0, 1, DateTimeKind.Utc).AddMilliseconds(1), t1.ToDateT… in ToDateTimeTruncation()
91 Assert.AreEqual(DateTimeKind.Utc, timestamp.ToDateTime().Kind); in AssertRoundtrip()
/external/grpc-grpc/src/csharp/Grpc.Core/Internal/
DTimespec.cs35 static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
183 …GrpcPreconditions.CheckArgument(dateTime.Kind == DateTimeKind.Utc, "dateTime needs of kind DateTim… in FromDateTime()
/external/rust/crates/chrono/benches/
Dchrono.rs9 use chrono::{DateTime, FixedOffset, Utc, __BenchYearFlags};
34 DateTime::<Utc>::from_str(str).unwrap() in bench_datetime_from_str()
/external/rust/crates/chrono/src/format/
Dparse.rs856 use {TimeZone, Utc}; in parse_rfc850()
861 let dt = Utc.ymd(1994, 11, 6).and_hms(8, 49, 37); in parse_rfc850()
867 assert_eq!(Ok(dt), Utc.datetime_from_str("Sunday, 06-Nov-94 08:49:37 GMT", RFC850_FMT)); in parse_rfc850()
872 (Utc.ymd(1994, 11, 7).and_hms(8, 49, 37), "Monday, 07-Nov-94 08:49:37 GMT"), in parse_rfc850()
873 (Utc.ymd(1994, 11, 8).and_hms(8, 49, 37), "Tuesday, 08-Nov-94 08:49:37 GMT"), in parse_rfc850()
874 (Utc.ymd(1994, 11, 9).and_hms(8, 49, 37), "Wednesday, 09-Nov-94 08:49:37 GMT"), in parse_rfc850()
875 (Utc.ymd(1994, 11, 10).and_hms(8, 49, 37), "Thursday, 10-Nov-94 08:49:37 GMT"), in parse_rfc850()
876 (Utc.ymd(1994, 11, 11).and_hms(8, 49, 37), "Friday, 11-Nov-94 08:49:37 GMT"), in parse_rfc850()
877 (Utc.ymd(1994, 11, 12).and_hms(8, 49, 37), "Saturday, 12-Nov-94 08:49:37 GMT"), in parse_rfc850()
881 assert_eq!(Ok(val.0), Utc.datetime_from_str(val.1, RFC850_FMT)); in parse_rfc850()
Dparsed.rs725 use offset::{FixedOffset, TimeZone, Utc};
1242 parse!(Utc; in test_parsed_to_datetime_with_timezone()
1245 Ok(Utc.ymd(2014, 12, 31).and_hms_nano(4, 26, 40, 12_345_678)) in test_parsed_to_datetime_with_timezone()
1248 parse!(Utc; in test_parsed_to_datetime_with_timezone()
1268 parse!(Utc; timestamp: 1_420_000_000, offset: 0), in test_parsed_to_datetime_with_timezone()
1269 Ok(Utc.ymd(2014, 12, 31).and_hms(4, 26, 40)) in test_parsed_to_datetime_with_timezone()
1271 assert_eq!(parse!(Utc; timestamp: 1_420_000_000, offset: 32400), Err(IMPOSSIBLE)); in test_parsed_to_datetime_with_timezone()
/external/protobuf/csharp/src/Google.Protobuf/WellKnownTypes/
DTimestampPartial.cs41 … private static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
148 if (dateTime.Kind != DateTimeKind.Utc) in FromDateTime()
/external/protobuf/csharp/src/Google.Protobuf.Test/
DJsonFormatterTest.cs379 new DateTime(1673, 6, 19, 12, 34, 56, DateTimeKind.Utc).ToTimestamp().ToString()); in TimestampStandalone_FromDateTime()
381 new DateTime(2015, 7, 31, 10, 29, 34, DateTimeKind.Utc).ToTimestamp().ToString()); in TimestampStandalone_FromDateTime()
506 var timestamp = new DateTime(1673, 6, 19, 12, 34, 56, DateTimeKind.Utc).ToTimestamp(); in AnyWellKnownType()
587 var value = new DateTime(1673, 6, 19, 12, 34, 56, DateTimeKind.Utc).ToTimestamp(); in WriteValue_Timestamp()
DJsonParserTest.cs862 var timestamp = new DateTime(1673, 6, 19, 12, 34, 56, DateTimeKind.Utc).ToTimestamp(); in Any_WellKnownType()
/external/rust/crates/chrono/src/naive/
Ddatetime.rs2235 two: Option<DateTime<Utc>>, in test_serde_bincode_optional()
2238 let expected = Test { one: Some(1), two: Some(Utc.ymd(1970, 1, 1).and_hms(0, 1, 1)) }; in test_serde_bincode_optional()
/external/protobuf/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Collections/
DRepeatedFieldTest.cs732 …eld<Timestamp> { Timestamp.FromDateTime(new DateTime(2015, 10, 1, 12, 34, 56, DateTimeKind.Utc)) }; in ToString_Timestamp()

12