This question shows research effort; it is useful and clear
1
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
我从用户那里读到 bMonth;
time_t timestamp = time(NULL);
tm* birthday = localtime(×tamp);
birthday->tm_mon = bMonth-1;
// now the tm_mon is set corectly
time_t birthStamp = mktime(birthday);
// now the tm_mon is 0