开发者

Format string for NSDateFormatter to produce milliseconds

Since my date is well formatted now all there is left for me to do is to print milliseconds too.

I already tried setDateFormat yyyy/mm/开发者_开发问答dd hh:mm:ss:ms

That didn't work. Any advice?


Try to use 'SS' specifier (with number of S's equal to number of digits you want to get - 3 in your case), e.g.

[formatter setDateFormat:@"yyyy/MM/dd hh:mm:ss:SSS"];


Try this format:

"yyyy/MM/dd HH:mm:ss.SSS"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜