tstring DateTime::toString() const { // "2005-12-26T24:59:59" sample format tstring time = toTimeString( _T( "HH':'mm':'ss" ) ); tstring date = toDateString( _T( "yyyy'-'MM'-'dd" ) ); return date + _T( "T" ) + time; }
/*! * \brief Fonction permettant de retourner une chaine de caractère comportant les éléments du log. * Fonction permettant de retourner une chaine de caractère comportant les éléments du log. * \return Retourne les éléments du log sous forme de texte : |criticité| , date heure => message. */ std::string LogMessage::toString() { QString tmp; tmp.append("|"); tmp.append(toDateString(criticite)); tmp.append("|, "); tmp.append(toDateString(date.tm_year + 1900)); tmp.append("-"); tmp.append(toDateString(date.tm_mon + 1)); tmp.append("-"); tmp.append(toDateString(date.tm_mday)); tmp.append(" "); tmp.append(toDateString(date.tm_hour)); tmp.append(":"); tmp.append(toDateString(date.tm_min)); tmp.append(":"); tmp.append(toDateString(date.tm_sec)); tmp.append(" => "); tmp.append(msg); return tmp.toStdString(); }
std::string cGameDate::toString( eDateFormat format ) { return toDateString( format ) + dateTimeSeparator + toTimeString(); }
std::string cGameDate::toDateString() { return toDateString( dateFormat ); }