首页 > 编程语言 > 详细

C++语言 之 标准库函数(4)

时间:2018-06-14 13:49:41      阅读:220      评论:0      收藏:0      [点我收藏+]

 标准C时间和日期函数

1、asctime():时间文本格式

#include <time.h>

Char *asctime(const struct tm *ptr);

 

2、Clock():返回自程序开始运行所经过的时间

#include <time.h>

Clock_t clock(void);

 

3、Ctime():返回特定格式时间

#include<time.h>

Char *ctime(onst time_t *time);

 

4、Difftime():两个时刻的间隔

#include <time.h>

Double difftime(time_t time2, time_t time1);

 

5、Gmtime():返回指向当前格林威治时间的指针

#include <time.h>

Struct tm *gmtime(const time_t *time);

 

6、Localtime():返回指向当前时间的指针

#include <time.h>

Struct tm *localtime(const time_t *time);

 

7、Mktime():返回指定时间的日历格式

#include <time.h>

Time_t mktime(struct tm *time);

 

8、Strftime():返回日期和时间的单个元素

#include <time.h>

Size_t strftime(char *str, size_t maxsize, const char *fmt, struct tm *time);

 

9、Time():返回系统的当前日历时间

#include <time.h>

Time_t time(time_t *time);

 

 

 

C++语言 之 标准库函数(4)

原文:https://www.cnblogs.com/Miraclesl/p/9182033.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!