int main()
{
char * timeTemp;
time_t theTime;
time( &theTime ); // get the calendar time
tm *t = localtime( &theTime ); // convert to local
cout << "The time is: " << asctime(t);
strncpy(timeTemp,(asctime(t))+11,8); //只获取时间部分
cout<<timeTemp<<endl;
return 0;
}