*
*/
#include <iostream>
-//#include "zypp/base/Logger.h"
+//#include <zypp/base/Logger.h>
-#include "zypp/base/String.h"
-#include "zypp/base/Xml.h"
+#include <zypp/base/String.h>
+#include <zypp/base/Xml.h>
-#include "zypp/Date.h"
+#include <zypp/Date.h>
using std::endl;
"%G-W%V-%u", ///< 2014-W06-5 (1 is Monday)
"%Y-%j", ///< 2014-038
};
- return fmt[static_cast<std::underlying_type<Date::DateFormat>::type>(dateFormat_r)];
+ return fmt[dateFormat_r.asIntegral()];
}
inline const char * _timeFormat( Date::TimeFormat timeFormat_r )
"%H:%M", ///< 07:06
"%H", ///< 07
};
- return fmt[static_cast<std::underlying_type<Date::TimeFormat>::type>(timeFormat_r)];
+ return fmt[timeFormat_r.asIntegral()];
}
inline const char * _timeZoneFormat( Date::TimeZoneFormat timeZoneFormat_r )
" %Z", ///< UTC, CET, ...
"%z", ///< +0000
};
- return fmt[static_cast<std::underlying_type<Date::TimeZoneFormat>::type>(timeZoneFormat_r)];
+ return fmt[timeZoneFormat_r.asIntegral()];
}
inline std::string doForm( const std::string & format_r, Date::TimeBase base_r, const Date::ValueType & date_r )
if ( dateFormat_r != DateFormat::none )
str << 'T';
str << _timeFormat( timeFormat_r );
- switch ( timeZoneFormat_r )
+ switch ( timeZoneFormat_r.asEnum() )
{
case TimeZoneFormat::none:
break;
{
return xmlout::node( str, name_r, {
{ "time_t", Date::ValueType(obj) },
- { "text", obj.printISO() },
+ { "text", obj.printISO( Date::TB_UTC ) },
} );
}