OGS
GetDateTime.h File Reference

Detailed Description

Definition in file GetDateTime.h.

#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 18 of file GetDateTime.h.

19{
20 if (stringDate.length() == 10)
21 return QDateTime::fromString(stringDate, "dd.MM.yyyy");
22
23 if (stringDate.length() == 19)
24 return QDateTime::fromString(stringDate, "dd.MM.yyyy.HH.mm.ss");
25
26 return QDateTime();
27}

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 30 of file GetDateTime.h.

31{
32 return getDateTime(QString::fromStdString(stringDate));
33}
QDateTime getDateTime(QString const &stringDate)
Converts string into QDateTime-format.
Definition GetDateTime.h:18

References getDateTime().