char * asctime ( const struct tm * tmptr );
Funkcja konwertuje strukturę Tm na łańcuch. Zwracany String ma format Www Mmm dd hh:mm:ss yyyy.
Parametry:<dl><dt>tmpr</dt><dd>Wskaźnik na strukturę tm
, do przekonwertowania</dd></dl>
Przykład
#include <cstdlib>
#include <iostream>
#include <time.h>
using namespace std;
int main(int argc, char *argv[])
{
time_t seku;
time(&seku);
struct tm *e;
e=localtime(&wsk_sekund);
cout<<asctime(e);
system("PAUSE");
return EXIT_SUCCESS;
}
Zobacz też: