let commenttime = "\(dict["newsoccurrencetime"]!)"
let timestampIntInMsec = Int.init(commenttime)
let timestampDoubleInSec:Double = Double(timestampIntInMsec!)/1000
print("timestampDoubleInSec=\(timestampDoubleInSec)")
let parsedDate:NSDate = NSDate(timeIntervalSince1970: TimeInterval(timestampDoubleInSec))
print("parsedDate=\(parsedDate)")
let date = "\(parsedDate)".substring(to: 10)
let newsOccurrencenTimeFrame = CGRect.init(x: newsSresourceLabel.frame.maxX + 12, y: newsSresourceLabel.frame.minY, width: 200, height: 40)
let newsOccurrencenTimeLabel = UILabel.init(frame: newsOccurrencenTimeFrame)
newsOccurrencenTimeLabel.text = date
newsOccurrencenTimeLabel.textColor = UIColor("#999999")
newsOccurrencenTimeLabel.font = UIFont.systemFont(ofSize: 13)
newsOccurrencenTimeLabel.sizeToFit()
bgView.addSubview(newsOccurrencenTimeLabel)
字符串类型日期用 年-月-日 形式显示
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。