# C++ problems date & time transaction

**URL:** <https://forum.kirupa.com/t/c-problems-date-time-transaction/161383>\
**Category:** programming\
**Created:** [September 3, 2005, 1:15pm UTC](https://forum.kirupa.com/t/c-problems-date-time-transaction/161383 "2005-09-03T13:15:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kitaeshi](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@kitaeshi](https://forum.kirupa.com/u/kitaeshi)\
**Post date:** [September 3, 2005, 1:15pm UTC](https://forum.kirupa.com/t/c-problems-date-time-transaction/161383/1 "2005-09-03T13:15:24Z")

</div>

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
