C++ problems date & time transaction

Hi all, i face another c++ problems again, hope any ppl here can help me solve the time & date problem. Moderater, sorry i can’t find any thread leading to C++. Hope you don’t mind

#include <iostream>
#include <stdio.h>
#include <time.h>
using namespace std;
int main(){
char logtran[100];
char datestr[8];
char timestr[8];
_strtime(datestr);
_strdate(timestr);
printf("the time is %s
", timestr);
logtran[1]=timestr;
cout << logtran[1];
return 0;
}

i wish to put the time into a array and display it but there are many errors.
Is there any way to log the time and date or how to correct the error.

Thxs