use ISO 8601 timestamps including timezone

for creation and last changed properties
This commit is contained in:
Sebastian Hoogen
2014-12-09 17:53:59 +01:00
parent b311c93262
commit 5c9e911a12
3 changed files with 9 additions and 8 deletions

View File

@@ -68,16 +68,16 @@ void TimeInfo::setTime_t (uint64_t seconds)
timebuffer.time = seconds;
}
const char* TimeInfo::currentDateTimeString()
std::string TimeInfo::currentDateTimeString()
{
char timebuff[30]= {0};
struct tm* systime;
time_t sec;
time(&sec);
systime = localtime(&sec);
const char* dt = asctime(systime);
return dt;
strftime(timebuff,30,"%Y-%m-%dT%H:%M:%S%z",systime);
return std::string(timebuff);
}
std::string TimeInfo::diffTime(const TimeInfo &timeStart,const TimeInfo &timeEnd )