On this page

time QML Value Type

This message communicates ROS Time defined here: https://design.ros2.org/articles/clock_and_time.html. More...

Import Statement: import QtRos2.BuiltinInterfaces
Status: Experimental Extension

Properties

Detailed Description

time is a structured value type usable in QML. It maps directly to the builtin_interfaces::msg::Time ROS 2 message type.

Construct a time in QML by assigning a JavaScript object whose keys are its component properties, or by setting those properties individually.

See also TimePublisher and TimeSubscriber.

Property Documentation

nanosec : uint32_t

The nanoseconds component, valid in the range [0, 1e9), to be added to the seconds component.

e.g. The time -1.7 seconds is represented as {sec: -2, nanosec: 3e8} The time 1.7 seconds is represented as {sec: 1, nanosec: 7e8}

sec : int32_t

The seconds component, valid over all int32 values.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.