当前位置:网站首页>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 .
边栏推荐
- Operations related to sequence table
- Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
- [datawhale202206] pytorch recommendation system: precision model deepfm & DIN
- Tencent Li Wei: deeply cultivate "regulatory technology" to escort the steady and long-term development of the digital economy
- Question d'entrevue de Huawei: recrutement
- 数据库之MHA高可用集群部署及故障切换
- Topic 1004: the story of cows (recursion)
- ANSI/UL 94 VTM薄质材料垂直燃烧测试
- System test UI test summary and questions (interview)
- (混更一篇)多个txt文本转一个表格
猜你喜欢

手机便签应用

I wish you all a happy reunion
![79. Word search [DFS + backtracking visit + traversal starting point]](/img/d6/a7693b2af435b7cf4562161ca4bd3f.png)
79. Word search [DFS + backtracking visit + traversal starting point]
![[datawhale202206] pytorch recommendation system: multi task learning esmm & MMOE](/img/8f/64fea641730795a2b5252cc2c8cdd2.png)
[datawhale202206] pytorch recommendation system: multi task learning esmm & MMOE

MHA high availability cluster deployment and failover of database

2022-06-28-06-29

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

What are the PHP FPM configuration parameters

Share several tools for designing exquisite circuit diagrams

【脑洞大开】《西潮》及《走向世界丛书》
随机推荐
Exploration and practice of inress in kubernetes
Accept different views with an open mind
使用BurpSuite对app抓包教程
Four years after graduation: work, resign, get married, buy a house
华为面试题: 招聘
Huawei interview question: Recruitment
Operations related to sequence table
ustime写出了bug
leetcode:226. Flip binary tree [DFS flip]
Ikvm of toolbox Net project new progress
Stack-------
MySQL workbench data modeling function
What are the solutions for session sharing of highly paid programmers & interview questions series 118?
Tencent Li Wei: deeply cultivate "regulatory technology" to escort the steady and long-term development of the digital economy
天青色等烟雨
[JS advanced] promise explanation
[datawhale202206] pytorch recommendation system: recall model DSSM & youtubednn
Nc100 converts strings to integers (ATOI)
Tencent security released the white paper on BOT Management | interpreting BOT attacks and exploring ways to protect
用.Net Core接入微信公众号开发