美文网首页
学习笔记:swift——自动日期格式

学习笔记:swift——自动日期格式

作者: 独居焚香 | 来源:发表于2015-12-09 10:45 被阅读72次
            let locale = NSLocale.currentLocale()
            let dateFormat = NSDateFormatter.dateFormatFromTemplate("yyyy-MM-dd", options: 0, locale: locale )
            let dateFormatter = NSDateFormatter()
            dateFormatter.dateFormat = dateFormat
            date.text = dateFormatter.stringFromDate(NSDate)
    

    相关文章

      网友评论

          本文标题:学习笔记:swift——自动日期格式

          本文链接:https://www.haomeiwen.com/subject/jwgehttx.html