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
Post a Comment