it's a bit hard to convert cxxtools::DateTime to RFC 822 (rss feed) date format:

<# target date format (RFC 822): Mon, 06 Sep 2009 16:20:00 +0000  #>
% cxxtools::DateTime lastupdate = feedManager.getLastUpdate();
% time_t rawtime;
% struct tm * timeinfo;
% const char * weekday[] = {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
% const char * monthname[] = {"NON",
%     "Jan","Feb","Mar",
%     "Apr","May","Jun",
%     "Jul","Aug","Sep",
%     "Oct","Nov","Dec"};
% std::string strhour;
% std::string strminute;
% std::string strsecond;
% time ( &rawtime );
% timeinfo = localtime ( &rawtime );
% timeinfo->tm_year = lastupdate.year();
% timeinfo->tm_mon = lastupdate.month();
% timeinfo->tm_mday = lastupdate.day();
% mktime ( timeinfo );
% if ( lastupdate.hour() < 10 ) {
%     strhour = "0" + cxxtools::convert<std::string>( lastupdate.hour() );
% } else {
%     strhour = cxxtools::convert<std::string>( lastupdate.hour() );
% };
% if ( lastupdate.minute() < 10 ) {
%     strminute =
%          "0" + cxxtools::convert<std::string>( lastupdate.minute() );
% } else {
%     strminute =
%          cxxtools::convert<std::string>( lastupdate.minute() );
% };
% if ( lastupdate.second() < 10 ) {
%     strsecond =
%          "0" + cxxtools::convert<std::string>( lastupdate.second() );
% } else {
%     strsecond =
%          cxxtools::convert<std::string>( lastupdate.second() );
% };

        <pubDate><$ weekday[timeinfo->tm_wday] $> , <$ lastupdate.day() $> <$
monthname[lastupdate.month()] $> <$ lastupdate.year() $> <$ strhour $>:<$
strminute $>:<$ strsecond $>  +0000 </pubDate>


Olaf


-------------------|-------------------|-------------------|-------------------|

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to