|
|
#2
lucky5635912010-12-22 07:53
|
方案— 优点:仅使用C标准库;缺点:只能精确到秒级
#include <time.h>
#include <stdio.h>
int main( void )
{
time_t t = time(0);
char tmp[64];
strftime( tmp, sizeof(tmp), "%Y/%m/%d %X %A 本年第%j天 %z",localtime(&t) );
puts( tmp );
return 0;
}
size_t strftime(char *strDest, size_t maxsize, const char *format, const struct tm *timeptr);
根据格式字符串生成字
这个时间怎么导入
class Product{
public:
string pname;
double price;
string deadline;
string pno,other;
};
中的deadline
希望各位帅哥美女们最好给个可以用的函数