YARP CiA-402 EtherCAT Device 0.6.0
YARP device plugin for EtherCAT CiA-402 drives
Loading...
Searching...
No Matches
TimeUtils.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Generative Bionics
2// SPDX-License-Identifier: BSD-3-Clause
3
4#ifndef YARP_DEV_CIA402_TIME_UTILS_H
5#define YARP_DEV_CIA402_TIME_UTILS_H
6
7#include <ctime>
8
9namespace CiA402
10{
11
13{
14 std::tm tm{};
15#ifdef _WIN32
16 localtime_s(&tm, &t);
17#else
18 localtime_r(&t, &tm);
19#endif
20 return tm;
21}
22
23} // namespace CiA402
24
25#endif // YARP_DEV_CIA402_TIME_UTILS_H
std::tm getLocalTime(const std::time_t &t)
Definition TimeUtils.h:12