0
我想今天的日期轉換成以下格式爲整數:目標C - 轉換的currentdate整數
年月日
例如2014年9月20日是20140926
下面的代碼工作在高於09代表9變得9無0以外的所有方面如何解決這個問題:
int todaysDate = [[NSString stringWithFormat:@"%d%d%d", (int)currentDate.year, currentDate.month, currentDate.day]integerValue];
輝煌 - 謝謝。我是否假設當它變成十月(即10)時,領先的0不會在那裏? – RGriffiths 2014-09-21 18:33:10
@RichardGriffiths - 是的,這是正確的。 – trudyscousin 2014-09-21 18:33:50