string Account::dateCreated(){
time_t rawtime;
struct tm * timeinfo;
char buffer [80];
time (&rawtime);
timeinfo = localtime (&rawtime);
strftime (buffer,80,"%a %b %d %T %Z %Y",timeinfo);
return buffer;
}
由于某种原因,这不会返回任何内容,但是当我稍微更改它时,它会起作用:
string Account::dateCreated(){
time_t rawtime;
struct tm * timeinfo;
char buffer [80];
time (&rawtime);
timeinfo = localtime (&rawtime);
strftime (buffer,80,"%A %d/%m/%Y",timeinfo);
return buffer;
}
之前的输出是:没有
现在的输出是:星期六13/01/2018