strftime

 

qi

std::string time_now() {
  time_t t = time(0);
  char tmp[64];
  strftime(tmp, sizeof(time), "%Y%m%dT%H%M%S", localtime(&t));
  return tmp;
}

  

re

1. 

http://www.cplusplus.com/reference/ctime/strftime/

2. 

http://man7.org/linux/man-pages/man3/strftime.3.html

end

posted on 2019-12-24 17:52  鹅要长大  阅读(292)  评论(0编辑  收藏  举报

导航