SHARE
TWEET

Untitled

a guest Sep 3rd, 2016 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. inline std::string dateTimeNow()
  2. {
  3.     const int RFC1123_TIME_LEN = 29;
  4.     time_t t;
  5.     struct tm *tm;
  6.  
  7.     std::string ret;
  8.     ret.resize(RFC1123_TIME_LEN);
  9.  
  10.     time(&t);
  11.     tm = localtime(&t);
  12.  
  13.     strftime(&ret[0], RFC1123_TIME_LEN + 1, "%a, %d %b %Y %H:%M:%S %z", tm);
  14.  
  15.     return ret;
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top