Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) std::asctime

 

std::asctime is an STL time function to convert std::tm to a std::string.

 

#include <ctime>
#include <iostream>

int main ()
{
  std::time_t my_time;

  std::time( &my_time );
  const std::tm * const time_and_date = std::localtime(&my_time);
  std::cout << std::asctime(time_and_date);
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict