Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux c获取时间 | α-LIB #106

Open
luyang14 opened this issue Jul 21, 2024 · 1 comment
Open

linux c获取时间 | α-LIB #106

luyang14 opened this issue Jul 21, 2024 · 1 comment

Comments

@luyang14
Copy link
Owner

http://iotts.com.cn/blog/2023/11/20/linux-c%E8%8E%B7%E5%8F%96%E6%97%B6%E9%97%B4/#more

在Linux C编程中,获取时间是一个常见的需求。可以使用系统提供的函数来获取当前时间,以及进行时间的格式化和计算。下面将详细介绍如何在Linux C中获取时间。 1. 获取当前时间 要获取当前时间,可以使用time函数。time函数返回自1970年1月1日以来经过的秒数。示例代码如下: 123456789#include <stdio.h>#include <time.h&gt

@luyang14
Copy link
Owner Author

终于明白了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant