diff --git a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp index df69e97e..96cb33da 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp @@ -16,6 +16,7 @@ #include +#include #include #include #include @@ -224,7 +225,7 @@ bool SubscriptionData::init() sub_data->add_new_message( std::make_unique( sample.get_payload().clone(), - sample.get_timestamp().value().get_time(), + std::chrono::system_clock::now().time_since_epoch().count(), std::move(attachment_data)), std::string(sample.get_keyexpr().as_string_view())); }, @@ -310,7 +311,7 @@ bool SubscriptionData::init() sub_data->add_new_message( std::make_unique( sample.get_payload().clone(), - sample.get_timestamp().value().get_time(), + std::chrono::system_clock::now().time_since_epoch().count(), std::move(attachment_data)), std::string(keystr.as_string_view())); },