MCPcopy Create free account
hub / github.com/cutechess/cutechess / dateTimeToKey

Method dateTimeToKey

projects/gui/3rdparty/qcustomplot/qcustomplot.cpp:6804–6811  ·  view source on GitHub ↗

! \overload A convenience method which turns a QDateTime object into a double value that corresponds to seconds since Epoch (1. Jan 1970, 00:00 UTC). This is the format used as axis coordinates by QCPAxisTickerDateTime. The accuracy achieved by this method is one millisecond, irrespective of the used Qt version (it works around the lack of a QDateTime::toMSecsSinceEpoch in Qt 4.6)

Source from the content-addressed store, hash-verified

6802 \see keyToDateTime
6803*/
6804double QCPAxisTickerDateTime::dateTimeToKey(const QDateTime &dateTime)
6805{
6806# if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
6807 return dateTime.toTime_t()+dateTime.time().msec()/1000.0;
6808# else
6809 return dateTime.toMSecsSinceEpoch()/1000.0;
6810# endif
6811}
6812
6813/*! \overload
6814

Callers

nothing calls this directly

Calls 1

timeMethod · 0.80

Tested by

no test coverage detected