質問

strftimeから日付(現在の時間)を取得し、それをiPhone-OS用のobj-cのnsstringに入れたいです。

役に立ちましたか?

解決 2

<のhref = "http://dblog.com.au/iphone-development/iphone-sdk-tip-function-for-getting-formatted-date-string-as-nsstring/" のrel = "nofollowをnoreferrer 「> http://dblog.com.au/iphone-development/iphone-sdk-tip-function-for-getting-formatted-date-string-as-nsstring/ の

他のヒント

使用することをお勧めします NSDateさんの descriptionWithCalendarFormat:timeZone:locale:. 。通話に関する詳細なドキュメントが見つかります。 ここ. 。API を使用すると、日付のどのコンポーネントを出力するかを指定できます。 NSString, 、これは API の戻り結果です。

アップデート: 本当に使いたいなら strftime それから、 const char*-その呼び出しからの型付きの結果を、 NSString* を使用して stringWithUTF8String. 。詳細については ここ.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top