File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
sdk/core/azure_core_amqp/src/fe2o3 Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,13 @@ const CE_ZERO_MILLISECONDS: i64 = -62_135_596_800_000;
4141
4242impl From < fe2o3_amqp_types:: primitives:: Timestamp > for AmqpTimestamp {
4343 fn from ( timestamp : fe2o3_amqp_types:: primitives:: Timestamp ) -> Self {
44+ // The AMQP timestamp is the number of milliseconds since the Unix epoch.
45+ // AMQP brokers represent the lowest value as -62_135_596_800_000 (the
46+ // number of milliseconds between the Unix epoch (1/1/1970) and year 1 CE) as
47+ // a sentinel for a time which is not set.
48+ if ( timestamp. milliseconds ( ) as u64 ) == CE_ZERO_MILLISECONDS as u64 {
49+ return AmqpTimestamp ( None ) ;
50+ }
4451 AmqpTimestamp (
4552 std:: time:: UNIX_EPOCH . checked_add ( std:: time:: Duration :: from_millis (
4653 timestamp. milliseconds ( ) as u64 ,
You can’t perform that action at this time.
0 commit comments