Top "Time-t" questions

`time_t` is a Standard-C data type to hold the seconds since UNIX epoch, that since the 1.1.1970.

Get the current time in C

I want to get the current time of my system. For that I'm using the following code in C: time_…

c time time-t localtime
What primitive data type is time_t?

I do not know the data type of time_t. Is it a float double or something else? Because if …

c types printf time-t
Time into string with HH:MM:SS format (C-programming)

I need to get the current time in a "HH:MM:SS"-format into a character array (string) so I …

c string time time-t
Format specifiers for implementation-defined types like time_t

I want to make my code more platform-/implementation-independent. I don't know what a time_t will be implemented as …

c printf typedef time-t
How to extract hours from time_t?

I want to extract hours, minutes and seconds as integer values from a time_t value representing seconds since epoch. …

c time time-t
Convert date and time numbers to time_t AND specify the timezone

I have the following integers: int y, mon, d, h, min, s; Their values are: 2012, 06, 27, 12, 47, 53 respectively. I want to represent …

c++ datetime timezone time-t
Is there any way to get 64-bit time_t in 32-bit programs in Linux?

On Windows I can call: _time32(__time32_t); // to get 32-bit time_t _time64(__time64_t); // to get 64-bit time_…

c linux gcc 64-bit time-t
What is the difference between clock_t, time_t and struct tm?

What is the difference between clock_t, time_t and struct tm? struct tm looks like this: struct tm{ int …

c time struct time-t time.h
How safe is it to assume time_t is in seconds?

I'm doing a lot of calculations with times, building time objects relative to other time objects by adding seconds. The …

c++ date time time-t
easy way to add 1 month to a time_t in C/C++

I have some code that uses the Oracle function add_months to increment a Date by X number of months. …

c++ c date time-t date-math