9#ifndef MRPT_SYSTEM_DATETIME_H
10#define MRPT_SYSTEM_DATETIME_H
17#define INVALID_TIMESTAMP (0)
EIGEN_STRONG_INLINE const AdjointReturnType t() const
Transpose.
double BASE_IMPEXP timeDifference(const mrpt::system::TTimeStamp &t_first, const mrpt::system::TTimeStamp &t_later)
Returns the time difference from t1 to t2 (positive if t2 is posterior to t1), in seconds.
double BASE_IMPEXP timestampTotime_t(const mrpt::system::TTimeStamp &t)
Transform from TTimeStamp to standard "time_t" (actually a double number, it can contain fractions of...
std::string BASE_IMPEXP formatTimeInterval(const double &timeSeconds)
Returns a formated string with the given time difference (passed as the number of seconds),...
std::string BASE_IMPEXP intervalFormat(const double seconds)
This function implements time interval formatting: Given a time in seconds, it will return a string d...
mrpt::system::TTimeStamp BASE_IMPEXP getCurrentLocalTime()
Returns the current (local) time.
std::string BASE_IMPEXP timeLocalToString(const mrpt::system::TTimeStamp &t, unsigned int secondFractionDigits=6)
Convert a timestamp into this textual form (in local time): HH:MM:SS.MMMMMM.
std::string BASE_IMPEXP dateTimeLocalToString(const mrpt::system::TTimeStamp &t)
Convert a timestamp into this textual form (in local time): YEAR/MONTH/DAY,HH:MM:SS....
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
double timestampToDouble(const mrpt::system::TTimeStamp &t)
Transform from TTimeStamp to standard "time_t" (actually a double number, it can contain fractions of...
std::string BASE_IMPEXP dateToString(const mrpt::system::TTimeStamp &t)
Convert a timestamp into this textual form: YEAR/MONTH/DAY.
std::string BASE_IMPEXP dateTimeToString(const mrpt::system::TTimeStamp &t)
Convert a timestamp into this textual form (UTC time): YEAR/MONTH/DAY,HH:MM:SS.MMM.
mrpt::system::TTimeStamp BASE_IMPEXP time_tToTimestamp(const double &t)
Transform from standard "time_t" (actually a double number, it can contain fractions of seconds) to T...
mrpt::system::TTimeStamp BASE_IMPEXP secondsToTimestamp(const double &nSeconds)
Transform a time interval (in seconds) into TTimeStamp (e.g.
double BASE_IMPEXP extractDayTimeFromTimestamp(const mrpt::system::TTimeStamp &t)
Returns the number of seconds ellapsed from midnight in the given timestamp.
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
mrpt::system::TTimeStamp BASE_IMPEXP getCurrentTime()
Returns the current (UTC) system time.
std::string BASE_IMPEXP timeToString(const mrpt::system::TTimeStamp &t)
Convert a timestamp into this textual form (UTC): HH:MM:SS.MMMMMM.
mrpt::system::TTimeStamp BASE_IMPEXP buildTimestampFromPartsLocalTime(const mrpt::system::TTimeParts &p)
Builds a timestamp from the parts (Parts are in local time)
mrpt::system::TTimeStamp BASE_IMPEXP buildTimestampFromParts(const mrpt::system::TTimeParts &p)
Builds a timestamp from the parts (Parts are in UTC)
void BASE_IMPEXP timestampToParts(TTimeStamp t, TTimeParts &p, bool localTime=false)
Gets the individual parts of a date/time (days, hours, minutes, seconds) - UTC time or local time.
mrpt::system::TTimeStamp BASE_IMPEXP timestampAdd(const mrpt::system::TTimeStamp &tim, const double num_seconds)
Shifts a timestamp the given amount of seconds (>0: forwards in time, <0: backwards)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
The parts of a date/time (it's like the standard 'tm' but with fractions of seconds).
uint8_t day_of_week
Seconds (0.0000-59.9999)
int daylight_saving
Day of week (1:Sunday, 7:Saturday)
uint8_t minute
Hour (0-23)
double second
Minute (0-59)