<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/111108>111108</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc] Make `time` libraries more future proof with respect to the `2038` problem
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Rajveer100
</td>
</tr>
</table>
<pre>
Currently the following files in `src/time`:
- `ctime.cpp`
- `ctime_r.cpp`
- `ctime_s.cpp`
Do this check:
```c++
*t_ptr > cpp::numeric_limits<int32_t>::max()
```
`time_t` may not be a 32 bit number, and making this check may cause problems in approximately 14 years:
[2038 Problem](https://en.wikipedia.org/wiki/Year_2038_problem)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0Us1q8zoQfZrxZmiQx05iL7xIm3p34XJ3dxUkeRKrkSwjyW3z9h9yAqWBD4SMNefMz5kjYzSXibmD7Stsj4Vc0uhD95_8-GQOpRCF8sOte1tC4CnZG6aR8eyt9V9muuDZWI5oJoSdiEED9ck4hp2A6gDiCOJxv2SAzrGNnuccf3o-hb8F4q_A_T56TKOJqEfW16dSGboeDfSaz_2VDuk0p4BQvWNOWB2gOkyL42D0yRpnUoTqzUypolOC6v0OcPIbqAFqn3I_FVwbTbAT6OQNJ59QMUqsCJVJOC1OcQB6QzkN6OQ1K_fT_8rRcomMc_DKslsVlfMc_LdxMrG9YVnjjWWIz8NuX0lUDf57J8L2CNSMKc0rkHqgnqfNl7mamQcjNz5cgPr8D9T_zzKcMv30qAvUFkNXDW3VyoK7ck-NoL0o62LsWGx3um641Yok1dTs6ayU2NfUtLquqTAdCapLIWqxr0RZb9qhKZtWktCl3g-lgFqwk8ZurP10uZPCxLhwV5ZlKZrCSsU2rj4kskZpIMqODF3Gv6jlEqEW1sQUfzIkk-zq3ZWwPeI_8sr42EjehzUqyGA4ovOB8bykJaw6-zN-mTRi4DizTpj8am3YiaxIpj5EKZZgu9-SXkwaF7XR3gH1uZfH52UO_oN1AurX0SJQ_5jus6M_AQAA__8M9gf5">