Actually I am parsing an email header like:
....
Date: Sun, 1 Feb 2009 18:51:32 +0200
Message-ID: <c56e0c650902010851u7edd6c83p3a86fc07a9b6957b@mail.gmail.com>
Subject: konux119
From: george wi <yrtgs@gmail.com>
To: Pr Test1 <prtest1@ford.com.tr>
Content-Type: multipart/alternative;
boundary=0016364571aa18aff90461de40d2
X-TM-AS-Product-Ver: IMSS-7.0.0.3127-5.5.0.1026-16438.00
X-TM-AS-Result: No-2.664-4.5-31-1
.......
....
Date: Sun, 1 Feb 2009 18:51:32 +0200
Message-ID: <c56e0c650902010851u7edd6c83p3a86fc07a9b6957b@mail.gmail.com>
Subject: konux119
From: george wi <yrtgs@gmail.com>
To: Pr Test1 <prtest1@ford.com.tr>
Content-Type: multipart/alternative;
boundary=0016364571aa18aff90461de40d2
X-TM-AS-Product-Ver: IMSS-7.0.0.3127-5.5.0.1026-16438.00
X-TM-AS-Result: No-2.664-4.5-31-1
.......
To copy to clipboard, switch view to plain text mode
I grab the "Date:.." part, clean unnecessary things...
I put day to day(in number format), month to month(that is character format), year to year..The actual code is:
dayremoved= dateHeader.section(",",1,1);
datelist = dayremoved.split(" ");
QDate todate
= QDate::fromString(day
+"/"+month
+"/"+year,
"dd/MMM/yyyy");
QString dayremoved;
QStringList datelist;
dayremoved= dateHeader.section(",",1,1);
datelist = dayremoved.split(" ");
QString day=datelist[1];
QString month=datelist[2];
QString year =datelist[3];
QDate todate= QDate::fromString(day+"/"+month+"/"+year,"dd/MMM/yyyy");
To copy to clipboard, switch view to plain text mode
QDate::fromString(input,
"dd MMM yyyy");
QDate::fromString(input, "dd MMM yyyy");
To copy to clipboard, switch view to plain text mode
also didn't work?
Bookmarks