ios - NSDateFormatter isn't getting correctly formatted -


i have nsdateformatter created. want print out seconds , milliseconds. here's code:

dateformatter.dateformat = "ss\(separator)sss"     let string = self.dateformatter.datefromstring(self.timelabel.text!) // timelabel.text = 3:29 println(string!) 

the println() prints out following:

2001-01-01 08:00:03 +000

all want print out, 3:29. seconds, , milliseconds. prints out different things. how can print out seconds , milliseconds?

with datefromstring converting string date. so, "string" date, not string. , when print "string" printing value of string's description, standard formatter, not using formatter.

if want format string date, use stringfromdate:


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -