格式化时间

//格式化时间

1
2
3
4
5
6
7
8
9
10
var formatter:NSTimeInterval = NSTimeInterval()
// formatter.stringForObjectValue(thetime)
formatter = 1420790950.580
var str:NSDate = NSDate(timeIntervalSince1970: formatter)
let df = NSDateFormatter()
df.dateFormat="yyyy-M-d” // yyyy.MM.dd HH:mm:ss
var ti = df.stringFromDate(str)
println(" 222 \(ti)")

Author

陈昭

Posted on

2016-08-24

Updated on

2021-12-27

Licensed under

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

Kommentare

You forgot to set the shortname for Disqus. Please set it in _config.yml.