boost::posix_time::microsec_clock::universal_time();
.
YYYY-MM-DDThh:mm:ss.sss
.
YYYY
is the yearMM
is the monthDD
is the dayT
is a separatorhh
is for hoursmm
is for minutesss
is for secondssss
(following the dot) is for millisecondsYYYY-MM-DDThh:mm:ss.ssssss
can be used (microsecond precision).
Example:
2021-07-07T13:54:05.123
See also this Wikipedia article for more details.
Original type (myTime) | Final type | Utility function |
---|---|---|
boost::posix_time::ptime | iso_extended_string | to_iso_extended_string(myTime) |
long double (Unix format) | iso_extended_string | HeexUtils::unixTimeToIsoExtendedTime(myTime) |
ros::Time | iso_extended_string | to_iso_extended_string(myTime.toBoost()) |
Original type (myTime) | Final type | Utility function |
---|---|---|
iso_extended_string | boost::posix_time::ptime | boost::posix_time::from_iso_extended_string(myTime) |
iso_extended_string | long double (Unix format) | HeexUtils::isoExtendedTimeToUnixTime(myTime) |
iso_extended_string | ros::Time | ros::Time::fromBoost(boost::posix_time::from_iso_extended_string(myTime)) |