我想使用getdate()打印ctime數據的年,月,日,小時,分鐘和秒。有人可以給我一個如何做到這一點的例子嗎?如何用C++語言/ getdate()定義表示時間值的值?
下面是代碼:
how can i define the DATA as a struct date time?
getdate(&DATE);
printf("The year is : %d\n",DATE.da_year);
printf("The month is : %d\n",DATE.da_month);
printf("The day is : %d\n",DATE.da_day);
也有人可以告訴我如何從OBJç轉換爲C++以下幾點:
(NSString *)conv_fromDateToString:(NSDate *)normalDate{ //code }
假設getdate()的意思是這樣的:http://pubs.opengroup.org/onlinepubs/009695399/functions/getdate.html它不會做你認爲它所做的事 - 閱讀文檔。 – 2011-05-26 07:31:42
你能告訴我如何定義一個代表時間值的值嗎?(用C++語言編寫) – marryy 2011-05-26 07:34:35