From cd750d2024ac35ba847fe703e915c246ac35a3a8 Mon Sep 17 00:00:00 2001 From: notdefine Date: Mon, 22 Sep 2008 20:01:01 +0000 Subject: [PATCH] Show Date in Network Tab using QT functions. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@736 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/NetworkDialog.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/retroshare-gui/src/gui/NetworkDialog.cpp b/retroshare-gui/src/gui/NetworkDialog.cpp index 7680bd35b..b512a2f45 100644 --- a/retroshare-gui/src/gui/NetworkDialog.cpp +++ b/retroshare-gui/src/gui/NetworkDialog.cpp @@ -301,16 +301,15 @@ void NetworkDialog::insertConnect() } else { out << "0"; // Is zero } + item -> setText(3, QString::fromStdString(out.str())); } else { // Dont Show a timestamp in RS calculate the day - time_t seconds; - seconds=detail.lastConnect; - struct tm *tmnow= localtime(&seconds); - // out << setfill ("0"); why does this not work? - out << tmnow->tm_hour << ":" << tmnow->tm_min << ":" << tmnow->tm_sec << " "; - out << tmnow->tm_mday << "." << tmnow->tm_mon + 1 << "." << tmnow->tm_year + 1900; + QDateTime datum = QDateTime::fromTime_t(detail.lastConnect); + // out << datum.toString(Qt::LocalDate); + QString stime = datum.toString(Qt::LocalDate); + + item -> setText(3, stime); } - item -> setText(3, QString::fromStdString(out.str())); } /* (4) Person */