Index: sources/utility/format.cpp =================================================================== diff -u -r64d87d540594252e8039ab2595016d98f1e3cc28 -r13d6a4fae2f910ab6e289ac9280258a94f734405 --- sources/utility/format.cpp (.../format.cpp) (revision 64d87d540594252e8039ab2595016d98f1e3cc28) +++ sources/utility/format.cpp (.../format.cpp) (revision 13d6a4fae2f910ab6e289ac9280258a94f734405) @@ -15,9 +15,10 @@ #include "format.h" // Qt +#include // Project -#include +#include "types.h" Format::Format() { } @@ -148,3 +149,16 @@ } return list; } + +/*! + * \brief Format::fromEpoch + * \details Converts the epoch (in seconds) to the date string format, formatted by vDateTimeFormat + * \param vEpoch - epoch + * \param vFormat - returned date time format + * \return the date time representation of the epoch in QString by vFormat. + */ +QString Format::fromEpoch(qint64 vEpoch, QString vFormat) +{ + QDateTime dateTime = QDateTime::fromSecsSinceEpoch(vEpoch); + return dateTime.toString(vFormat); +}