How to fix C++ error: 'put_time' is not a member of 'std'

Problem:

While trying to compile your C++ application, you see an error message such as

src/HTTPServer.cpp:12:16: error: 'put_time' is not a member of 'std'
     ss << std::put_time(std::localtime(&localTime), "%FT%H-%M-%SZ");;
                ^~~~~~~~

Solution

At the top of the file where this error occured, you need to add

#include <iomanip>

iomanip contains std::put_time() among other functionality.