编程语言
首页 > 编程语言> > c++ 获取年初时间戳

c++ 获取年初时间戳

作者:互联网

int GetYearBeginTime(UINT iTmpStamp, UINT& iStamp)
{
  time_t tick = static_cast<time_t>(iTmpStamp);
  struct tm * standard = localtime(&tick);
  standard->tm_mon = 0;
  standard->tm_mday = 1;
  standard->tm_hour = 0;
  standard->tm_min = 0;
  standard->tm_sec = 0;
  iStamp = static_cast<UINT>(mktime(standard));
  return TRUE;
}

标签:年初,cast,c++,standard,iStamp,获取,tm,UINT,tick
来源: https://www.cnblogs.com/longma8586/p/13875515.html