下文主要列了下时间函数,具体用时,还是要查看文档的详细说明
时间函数 asctime, _wasctime, asctime_s, _wasctime_s将结构体struct tm的时间转换成字符串的时间,带_s的函数更安全,推荐使用。struct tm通常由 gmtime或localtime获取。函数根据当前系统本地时间区域设置进行格式化输出字符串的时间。
clock返回当前进程已运行的cpu时钟滴答数。
ctime, _ctime32, _ctime64, _wctime, _wctime32, _wctime64, _ctime_s, _ctime32_s, _ctime64_s, _wctime_s, _wctime32_s, _wctime64_s将time_t, __time32_t, __time64_t的时间转换成字符串的时间,带_s的函数更安全,推荐使用。前述时间依次由函数time, _time32, _time64返回。函数根据当前系统本地时间区域设置进行格式化输出字符串的时间。
difftime, _difftime32, _difftime64返回两个时间(time_t或 __time32_t或__time64_t)之差,单位是秒,
_ftime, _ftime32, _ftime64, _ftime_s, _ftime32_s, _ftime64_s将当前系统时间通过类型struct _timeb 或struct __timeb64返回,存储的时间是coordinated universal time (UTC)。带_s的函数更安全,推荐使用。
_futime, _futime32, _futime64设置文件的修改时间
gmtime, _gmtime32, _gmtime64, gmtime_s, _gmtime32_s, _gmtime64_s将类型time_t或__time64_t的时间转换成类型struct tm的时间,带_s的函数更安全,推荐使用。
localtime, _localtime32, _localtime64, localtime_s, _localtime32_s, _localtime64_s将类型time_t或__time64_t的时间按本地区域时间设置转换成类型struct tm的时间,带_s的函数更安全,推荐使用。
_mkgmtime, _mkgmtime32, _mkgmtime64将类型为struct tm的UTC时间转换成类型为time_t或__time64_t的UTC时间。
mktime, _mktime32, _mktime64Convert time to calendar value.
_mktime32 returns the specified calendar time encoded as a value of type time_t. If timeptr references a date before midnight, January 1, 1970, or if the calendar time cannot be represented, _mktime32 returns –1 cast to type time_t. When using _mktime32 and if timeptr references a date after 03:14:07 January 19, 2038, Coordinated Universal Time (UTC), it will return –1 cast to type time_t.
_mktime64 will return –1 cast to type __time64_t if timeptr references a date after 23:59:59, December 31, 3000, UTC.
_strdate, _wstrdate, _strdate_s, _wstrdate_sReturn current system date as string. The versions of these functions with the _s suffix are more secure.
More secure versions of these functions are available; see _strdate_s, _wstrdate_s. It is recommended that the more secure functions be used wherever possible.
The _strdate function copies the current system date to the buffer pointed to by datestr, formatted mm/dd/yy, where mm is two digits representing the month, dd is two digits representing the day, and yy is the last two digits of the year. For example, the string 12/05/99 represents December 5, 1999. The buffer must be at least 9 bytes long.
If datestr is a NULL pointer, the invalid parameter handler is invoked, as described in Parameter Validation. If execution is allowed to continue, these functions return -1 and set errno to EINVAL.
_wstrdate is a wide-character version of _strdate; the argument and return value of _wstrdate are wide-character strings. These functions behave identically otherwise.
strftime, wcsftime, _strftime_l, _wcsftime_lFormat date-and-time string for international use.
_strtime, _wstrtime, _strtime_s, _wstrtime_sReturn current system time as string. The versions of these functions with the _s suffix are more secure.
time, _time32, _time64返回类型为time_t或 __time32_t或__time64_t的当前系统时间(自1970-01-01 00:00:00经过的秒数),UTC格式
_tzsetSet external time variables from environment time variable TZ.
Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.
Set modification time for specified file using either current time or time value stored in structure.
Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.



