C与Objective-C编程入门:时间处理、内存管理与对象操作
1. C语言中的时间处理
在C编程中, struct tm 结构体用于将时间分解为各个组成部分,其定义如下:
struct tm {
int tm_sec; /* seconds after the minute [0-60] */
int tm_min; /* minutes after the hour [0-59] */
int tm_hour; /* hours since midnight [0-23] */
int tm_mday; /* day of the month [1-31] */
int tm_mon; /* months since January [0-11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday [0-6] */
int tm_yday; /* days since January 1 [0-365] */
int tm_isdst; /* Daylight Savings Time flag */
long tm_gmtoff; /* offset from CUT in seconds */
char *tm_zone; /* timezone abbreviation */
};
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



