首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

ctime

这个标头最初在C标准库中作为<time.h>...

此标头是C型日期和时间图书馆。

宏常数

CLOCKS_PER_SEC

number of processor clock ticks per second (macro constant)

NULL

implementation-defined null pointer constant (macro constant)

类型

clock_t

process running time (typedef)

size_t

unsigned integer type returned by the sizeof operator (typedef)

time_t

time since epoch type (typedef)

tm

calendar time type (class)

timespec (since C++17)

time in seconds and nanoseconds (struct)

功能

时间操纵

*。

时钟自程序启动后返回原始处理器时钟时间%28功能%29

时间作为时间返回系统的当前时间,因为时代%28功能%29。

衍射时间计算时间的差值%28%函数%29

时间语c[医]获取%28,因为C++17%29根据给定的时基%28函数%29返回日历时间

格式转换

时间转换时间[医]对象为文本表示形式%28函数%29

提升时间将tm对象转换为文本表示形式%28功能%29

strftime将tm对象转换为自定义文本表示形式%28功能%29

wcsftime将tm对象转换为自定义宽字符串文本表示形式%28功能%29。

gmtime将自历法以来的时间转换为日历时间,表示为通用协调时间%28功能%29

本地时间将自纪元以来的时间转换为以本地时间%28功能%29表示的日历时间

mktime自历法%28功能%29起,就会不时地转换日历。

Synopsys

二次

代码语言:javascript
复制
#define NULL /* see definition */
#define CLOCKS_PER_SEC /* see definition */
#define TIME_UTC /* see definition */
namespace std {
  using size_t = /* see definition */;
  using clock_t = /* see definition */;
  using time_t = /* see definition */;
  struct timespec;
  struct tm;
  clock_t clock();
  double difftime(time_t time1, time_t time0);
  time_t mktime(struct tm* timeptr);
  time_t time(time_t* timer);
  int timespec_get(timespec* ts, int base);
  char* asctime(const struct tm* timeptr);
  char* ctime(const time_t* timer);
  struct tm* gmtime(const time_t* timer);
  struct tm* localtime(const time_t* timer);
  size_t strftime(char* s, size_t maxsize, const char* format, const struct tm* timeptr);
}

二次

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券