By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,730 Members | 1,480 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,730 IT Pros & Developers. It's quick & easy.

Unix time memory problem

P: 3
Already answered- thanks
1 Week Ago #1

✓ answered by SioSio

In traditional UNIX implementations, time_t was an int, and the int was signed 32 bits. The count starts with 0:00:00 on January 1, 1970, universal time, as 0 seconds.
Therefore, the maximum value is (2^31−1) = 2,147,483,647, and it can handle 2,147,483,647 seconds (≒ 68 years, until 3:14:07 on January 19, 2038).
If the time_t type is changed to a signed 64-bit integer type, the maximum value is (2^63-1) = 9,223,372,036,854,775,807, and can be used up to 300 billion years in the Christian era.

Based on this, it is 36 bits to be able to count until the end of 3038.

Share this Question
Share on Google+
2 Replies


P: 51
In traditional UNIX implementations, time_t was an int, and the int was signed 32 bits. The count starts with 0:00:00 on January 1, 1970, universal time, as 0 seconds.
Therefore, the maximum value is (2^31−1) = 2,147,483,647, and it can handle 2,147,483,647 seconds (≒ 68 years, until 3:14:07 on January 19, 2038).
If the time_t type is changed to a signed 64-bit integer type, the maximum value is (2^63-1) = 9,223,372,036,854,775,807, and can be used up to 300 billion years in the Christian era.

Based on this, it is 36 bits to be able to count until the end of 3038.
6 Days Ago #2

dev7060
Expert 100+
P: 162
The whole thread doesn't make sense without the original post. It isn't appropriate to remove the question. The discussion may benefit others as well. Same thing noticed here.
6 Days Ago #3

Post your reply

Sign in to post your reply or Sign up for a free account.