From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/c/chrono%2Ftime_t.html | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 devdocs/c/chrono%2Ftime_t.html (limited to 'devdocs/c/chrono%2Ftime_t.html') diff --git a/devdocs/c/chrono%2Ftime_t.html b/devdocs/c/chrono%2Ftime_t.html new file mode 100644 index 00000000..d6e589de --- /dev/null +++ b/devdocs/c/chrono%2Ftime_t.html @@ -0,0 +1,38 @@ +

time_t

Defined in header <time.h>
typedef /* unspecified */ time_t;
+

Real arithmetic type capable of representing times.

+

Although not defined by the C standard, this is almost always an integral value holding the number of seconds (not counting leap seconds) since 00:00, Jan 1 1970 UTC, corresponding to POSIX time.

+

Notes

The standard uses the term calendar time when referring to a value of type time_t.

+

Example

+

Show the start of the epoch.

+
#include <stdio.h>
+#include <time.h>
+#include <stdint.h>
+ 
+int main(void)
+{
+    time_t epoch = 0;
+    printf("%jd seconds since the epoch began\n", (intmax_t)epoch);
+    printf("%s", asctime(gmtime(&epoch)));
+}

Possible output:

+
0 seconds since the epoch began
+Thu Jan  1 00:00:00 1970

References

See also

+ + + +
returns the current calendar time of the system as time since epoch
(function)
+
(C23)(C11)
converts time since epoch to calendar time expressed as local time
(function)
+
(C23)(C11)
converts time since epoch to calendar time expressed as Coordinated Universal Time (UTC)
(function)
C++ documentation for time_t
+

+ © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
+ https://en.cppreference.com/w/c/chrono/time_t +

+
-- cgit v1.2.3