OGS
GetDateTime.h File Reference
#include <QDateTime>
#include <QString>
#include <string>
Include dependency graph for GetDateTime.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

QDateTime getDateTime (QString const &stringDate)
 Converts string into QDateTime-format.
QDateTime getDateTime (std::string const &stringDate)
 Converts string into QDateTime-format.

Function Documentation

◆ getDateTime() [1/2]

QDateTime getDateTime ( QString const & stringDate)
inline

Converts string into QDateTime-format.

Definition at line 11 of file GetDateTime.h.

12{
13 if (stringDate.length() == 10)
14 return QDateTime::fromString(stringDate, "dd.MM.yyyy");
15
16 if (stringDate.length() == 19)
17 return QDateTime::fromString(stringDate, "dd.MM.yyyy.HH.mm.ss");
18
19 return QDateTime();
20}

Referenced by DiagramPrefsDialog::accept(), getDateTime(), DiagramList::readList(), and DiagramList::readList().

◆ getDateTime() [2/2]

QDateTime getDateTime ( std::string const & stringDate)
inline

Converts string into QDateTime-format.

Definition at line 23 of file GetDateTime.h.

24{
25 return getDateTime(QString::fromStdString(stringDate));
26}
QDateTime getDateTime(QString const &stringDate)
Converts string into QDateTime-format.
Definition GetDateTime.h:11

References getDateTime().