当前位置:网站首页>Localtime can't re-enter. It's a pit
Localtime can't re-enter. It's a pit
2022-07-01 12:41:00 【Tao song remains the same】
Recently, I stepped in a pit , All bye localtime Bestowed , because localtime Can't re-enter :
[email protected]:~$ man localtime
CTIME(3) Linux Programmer's Manual CTIME(3)
NAME
asctime, ctime, gmtime, localtime, mktime, asctime_r, ctime_r, gmtime_r, localtime_r - transform date and time to broken-
down time or ASCII
SYNOPSIS
#include <time.h>
char *asctime(const struct tm *tm);
char *asctime_r(const struct tm *tm, char *buf);
char *ctime(const time_t *timep);
char *ctime_r(const time_t *timep, char *buf);
struct tm *gmtime(const time_t *timep);
struct tm *gmtime_r(const time_t *timep, struct tm *result);
struct tm *localtime(const time_t *timep);
struct tm *localtime_r(const time_t *timep, struct tm *result);
time_t mktime(struct tm *tm);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
asctime_r(), ctime_r(), gmtime_r(), localtime_r():
_POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _BSD_SOURCE || _SVID_SOURCE || _POSIX_SOURCE
DESCRIPTION
The ctime(), gmtime() and localtime() functions all take an argument of data type time_t, which represents calendar time.
When interpreted as an absolute time value, it represents the number of seconds elapsed since the Epoch, 1970-01-01
00:00:00 +0000 (UTC).
The asctime() and mktime() functions both take an argument representing broken-down time, which is a representation sepa[m
rated into year, month, day, and so on.
Broken-down time is stored in the structure tm, which is defined in <time.h> as follows:
struct tm {
int tm_sec; /* Seconds (0-60) */
int tm_min; /* Minutes (0-59) */
int tm_hour; /* Hours (0-23) */
int tm_mday; /* Day of the month (1-31) */
int tm_mon; /* Month (0-11) */
int tm_year; /* Year - 1900 */
int tm_wday; /* Day of the week (0-6, Sunday = 0) */
int tm_yday; /* Day in the year (0-365, 1 Jan = 0) */
int tm_isdst; /* Daylight saving time */
};You really need to be careful .
边栏推荐
- 华为面试题: 招聘
- GID:旷视提出全方位的检测模型知识蒸馏 | CVPR 2021
- MHA high availability cluster deployment and failover of database
- redis探索之缓存击穿、缓存雪崩、缓存穿透
- Manage nodejs with NVM (downgrade the high version to the low version)
- 阿霍的三个阶段
- Operations related to sequence table
- Wechat applet - 80 practical examples of wechat applet projects
- 下半年还有很多事要做
- [JS] interview questions
猜你喜欢
![leetcode:329. The longest incremental path in the matrix [DFS + cache + no backtracking + elegance]](/img/10/acd162c3adf9d6f14fa5a551dc0d25.png)
leetcode:329. The longest incremental path in the matrix [DFS + cache + no backtracking + elegance]

Chained storage of queues

工具箱之 IKVM.NET 项目新进展

项目部署,一点也不难!

基于开源流批一体数据同步引擎 ChunJun 数据还原 —DDL 解析模块的实战分享

Common chart usage of Bi tools

VS Code 设置单击打开新文件窗口,不覆盖前一个窗口

Stack-------

logstash报错:Cannot reload pipeline, because the existing pipeline is not reloadable

leetcode:226. 翻转二叉树【dfs翻转】
随机推荐
快速整明白Redis中的压缩列表到底是个啥
leetcode:241. Design priority for operation expression [DFS + Eval]
基因检测,如何帮助患者对抗疾病?
Good luck brought by years of persistence
Digital signal processing -- Design of linear phase (Ⅱ, Ⅳ) FIR filter (2)
系统测试UI测试总结与问题(面试)
Logstash error: cannot reload pipeline, because the existing pipeline is not reloadable
阿霍的三个阶段
QT 播放器之列表[通俗易懂]
Eurake分区理解
localtime居然不可重入,踩坑了
[Maui] add click events for label, image and other controls
腾讯安全联合毕马威发布监管科技白皮书,解析“3+3”热点应用场景
【脑洞大开】《西潮》及《走向世界丛书》
Tencent Li Wei: deeply cultivate "regulatory technology" to escort the steady and long-term development of the digital economy
ASTM D 3801 vertical burning test of solid plastics
[encounter Django] - (II) database configuration
Teach you to complete the actual battle of image classification hand in hand -- Image Recognition Based on convolutional neural network
基于开源流批一体数据同步引擎 ChunJun 数据还原 —DDL 解析模块的实战分享
Zero copy technology of MySQL