25#ifndef GOBY_TIME_LEGACY_H
26#define GOBY_TIME_LEGACY_H
43[[deprecated(
"use time::convert()")]]
inline double
49[[deprecated(
"use time::convert()")]]
inline boost::posix_time::ptime
55[[deprecated(
"use time::convert()")]]
inline std::uint64_t
61[[deprecated(
"use time::convert()")]]
inline boost::posix_time::ptime
70template <
typename To,
typename From>
71[[deprecated(
"use time::convert()")]]
typename boost::enable_if<
72 boost::mpl::and_<boost::is_same<To, double>, boost::is_same<From, boost::posix_time::ptime> >,
79template <
typename To,
typename From>
80[[deprecated(
"use time::convert()")]]
typename boost::enable_if<
81 boost::mpl::and_<boost::is_same<To, boost::posix_time::ptime>, boost::is_same<From, double> >,
88template <
typename To,
typename From>
89[[deprecated(
"use time::convert()")]]
90 typename boost::enable_if<boost::mpl::and_<boost::is_same<To, std::uint64_t>,
91 boost::is_same<From, boost::posix_time::ptime> >,
98template <
typename To,
typename From>
99[[deprecated(
"use time::convert()")]]
100 typename boost::enable_if<boost::mpl::and_<boost::is_same<To, boost::posix_time::ptime>,
101 boost::is_same<From, std::uint64_t> >,
111template <
typename ReturnType>
112[[deprecated(
"use goby::time::SystemClock::now()")]] ReturnType
goby_time() {
113 static_assert(
sizeof(ReturnType) == 0,
"Invalid ReturnType for goby_time<>()");
117[[deprecated(
"use goby::time::SystemClock::now<goby::time::MicroTime>().value()")]]
inline std::
124[[deprecated(
"use goby::time::SystemClock::now<goby::time::SITime>().value()")]]
inline double
131[[deprecated(
"use goby::time::SystemClock::now<boost::posix_time::ptime>()")]]
inline boost::
138[[deprecated(
"use goby::time::SystemClock::now<boost::posix_time::ptime>()")]]
inline boost::
152[[deprecated(
"use goby::time::str()")]]
inline std::string
161 using namespace boost::posix_time;
162 return to_iso_string(second_clock::universal_time());
166[[deprecated]]
inline boost::posix_time::ptime
time_t2ptime(std::time_t t)
168 return boost::posix_time::from_time_t(t);
172[[deprecated]]
inline std::time_t
ptime2time_t(boost::posix_time::ptime t)
174 std::tm out = boost::posix_time::to_tm(t);
178[[deprecated(
"use convert_from_nmea")]]
inline boost::posix_time::ptime
Deprecated functions largely related to time handling (use goby::time for new work).
boost::posix_time::ptime nmea_time2ptime(const std::string &mt)
double ptime2unix_double(boost::posix_time::ptime given_time)
std::string goby_time< std::string >()
Returns current UTC time as a human-readable string.
std::time_t ptime2time_t(boost::posix_time::ptime t)
convert from ptime to time_t from time.h (whole seconds since UNIX)
double goby_time< double >()
std::uint64_t ptime2unix_microsec(boost::posix_time::ptime given_time)
boost::posix_time::ptime goby_time< boost::posix_time::ptime >()
boost::posix_time::ptime unix_microsec2ptime(std::uint64_t given_time)
boost::posix_time::ptime unix_double2ptime(double given_time)
std::string goby_file_timestamp()
ISO string representation of goby_time().
boost::posix_time::ptime time_t2ptime(std::time_t t)
convert to ptime from time_t from time.h (whole seconds since UNIX)
std::uint64_t goby_time< std::uint64_t >()
std::string goby_time_as_string(const boost::posix_time::ptime &t=goby_time())
Simple string representation of goby_time().
ToTimeType convert_from_nmea(const std::string &utc, boost::gregorian::date return_date=boost::gregorian::day_clock::universal_day())
Convert from NMEA0183 time representations (i.e. "HHMMSS[.SSSS]") to any time format supported by the...
ToTimeType convert(FromTimeType from_time)
Convert between time representations (this function works for tautological conversions).
boost::enable_if< boost::mpl::and_< boost::is_same< To, double >, boost::is_same< From, boost::posix_time::ptime > >, To >::type as(const From &from)
The global namespace for the Goby project.
static time_point now() noexcept
Returns the current system time unless SimulatorSettings::using_sim_time is set to true,...