User Tools

Site Tools


programming:cpp:unixtime

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
programming:cpp:unixtime [2022/05/05 07:48]
odagawa
programming:cpp:unixtime [2022/09/12 08:38] (current)
odagawa
Line 17: Line 17:
      
   time_t now = std::time(nullptr); // 現在時刻   time_t now = std::time(nullptr); // 現在時刻
-  tm *tm_event = localtime(&unixtime); // 現地時間に直す+  tm *tm_event = localtime(&now); // 現地時間に直す
      
   int year = tm_event->tm_year + 1900; // tm_year は 1900 年始まり   int year = tm_event->tm_year + 1900; // tm_year は 1900 年始まり
programming/cpp/unixtime.1651736910.txt.gz · Last modified: 2022/05/05 07:48 by odagawa