Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inline std::string dateTimeNow()
- {
- const int RFC1123_TIME_LEN = 29;
- time_t t;
- struct tm *tm;
- std::string ret;
- ret.resize(RFC1123_TIME_LEN);
- time(&t);
- tm = localtime(&t);
- strftime(&ret[0], RFC1123_TIME_LEN + 1, "%a, %d %b %Y %H:%M:%S %z", tm);
- return ret;
- }
Add Comment
Please, Sign In to add comment