c++ time

struct tm{
	int tm_sec;
	int tm_min;
	int tm_hour;
	int tm_mday;	// day of month
	int tm_mon;
	int tm_year;
	int tm_wday;	// day of week
	int tm_yday;	// day of year
	int tm_isdst;	// daylight saving time
};
std::clock();				returns std::clock_t values
std::time_t std::time(std::time_t *);	returns std::time_t values
char *ctime(const std::time_t *arg);	// converts std::time_t value into string
std::tm* gmtime(std::time_t *arg);	// converts time_t to UTC(Cordinated Universal Time) tm
std::tm* localtime(std::time_t *arg);	// converts time_t to local tm
std::time_t mktime(std::tm *arg);	// converts tm to time_t
char* asctime(std::tm *arg);		// converts tm to string 'Www Mmm dd hh:mm:ss yyyy'
// converts tm to string according to format and store into str with at max count chars
// format: %Y %m %d %H %M %S : Year month day Hour Minite Secode
std::size_t strftime( char* str, std::size_t count, const char* format, const std::tm* time );
get time() then parse time_t to tm object, then convert tm object to time strings

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值