0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

メモ: 2038年問題の例

Last updated at Posted at 2020-09-13

参考

サンプル

# include <time.h>
# include <stdio.h>

int main() {
        time_t test;
        time(&test);
        printf("今年は:%ld\n", (1970 + test/3600/24/365));

        test += 17*365*24*3600;
        printf("17年後は:%ld\n", (1970 + test/3600/24/365));

        test += 1*365*24*3600;
        printf("18年後は:%ld\n", (1970 + test/3600/24/365));

        return 0;
}
今年は2020
17年後は2037
18年後は1903

※32bit GCCでビルド。

情報

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?