#include <iostream>
      using namespace std;
      
      std::string get_timestamp() {
        time_t now = time(NULL);
        struct tm* ltm = localtime(&now);
        char buffer[80];
        strftime(buffer, 80, "%Y-%m-%d-%H-%M-%S", ltm);
        return std::string(buffer);
      }
      
      Cpp language logo

      Get timestamp

      Codiga's C++ Recipes

      Get timestamp from localtime

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.