A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../../cpp/../cpp/../cpp/../cpp/../c/chrono/time_t.html below:

time_t - cppreference.com

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.

[edit] Notes

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

[edit] 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
[edit] References
[edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4