1

ユーザーから bMonth を読み取りました。

time_t timestamp = time(NULL);
tm* birthday = localtime(&timestamp);

birthday->tm_mon = bMonth-1;

// now the tm_mon is set corectly

time_t birthStamp = mktime(birthday);

// now the tm_mon is 0

mktime が値を変更するのはなぜですか?

4

1 に答える 1