我對這個很困惑。如何在當前時間添加時間
我想抓取當前時間比根據條件我想添加所需時間到當前時間。例如, 。
current time = 06:47:10
//or should i hv to change this format to "2011-03-26 06:47:10 GMT"
if(a= 1 and b= min)
{ //add 1 min to
current time
}
else if(a= 1 and b= hour)
{ //add 1
hour to current time
}
else if(a= 1 and b=week)
{ //add 1
week to current time
}
只需要將上述條件的輸出添加到當前時間。
請指導我這個。
Regards
請再檢查一下這個答案 http://stackoverflow.com/questions/11019709/add-90-min-to-nsdate/29542106#29542106 – 2015-04-09 15:04:49