NSDateFormatter string format for displaying milliseconds

I need to get the current date in this format:

yyyy-MM-dd-hh-mm-ss-XXX

But what letters should you use for milliseconds?

+3
objective-c nsdateformatter


source to share


2 answers


As described by Unicode , S

means fractional second:

Fractional second round - number of letters. (example for 12.34567)



Use as much as possible S

for a given accuracy.

+5


source to share


The letters for miliseconds are SS, so you should do:



yyyy-MM-dd-hh-mm-ss-sss

+4


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics