The server send my a date format evry time on GMT null format... Greenw...
"Wed, 07 Feb 2007 18:44:19 GMT"
to append one one H i make so...
dateTime2.addSecs(3600); /* by hand ....*/
but how i can discovery a calculable local date.... +1 or -1
muss i build a switsch for evry 24 world H. time....
I like Unix time format to display human readable time and to see diff from localfile lastmod time.... (QFileInfo)
/* grab remote server gmt time to check localfile lastmod update or not */
uint MailTimeString
( QString indate
)
{
/* incomming format Wed, 07 Feb 2007 18:44:19 GMT*/
/* or mail rtf Date format! http://www.faqs.org/rfcs/rfc788.html */
indate.replace("Date:","");
indate.trimmed();
if (sdate.size() != 6) {
return QTime_Null(); /* time current uint format */
}
sdate.removeFirst();
sdate.removeLast();
QString reformat
= sdate.
join(" ");
QDateTime dateTime3
= dateTime2.
addSecs(3600);
/* GMT +1 switzerland */
QLocale::system();
/* on comment out time is bad */
return dateTime3.toTime_t();
}
/* grab remote server gmt time to check localfile lastmod update or not */
uint MailTimeString( QString indate )
{
/* incomming format Wed, 07 Feb 2007 18:44:19 GMT*/
/* or mail rtf Date format! http://www.faqs.org/rfcs/rfc788.html */
indate.replace("Date:","");
indate.trimmed();
QLocale::setDefault(QLocale::C); /* on comment out time is bad */
QStringList sdate = indate.split(" ");
if (sdate.size() != 6) {
return QTime_Null(); /* time current uint format */
}
sdate.removeFirst();
sdate.removeLast();
QString reformat = sdate.join(" ");
QDateTime dateTime2 = QDateTime::fromString(reformat,"dd MMM yyyy HH:mm:ss");
QDateTime dateTime3 = dateTime2.addSecs(3600); /* GMT +1 switzerland */
QLocale::system(); /* on comment out time is bad */
return dateTime3.toTime_t();
}
To copy to clipboard, switch view to plain text mode
Bookmarks