|
@@ -696,8 +696,18 @@ public func updateTimeToCurrenTime(timeInterval: TimeInterval) -> String {
|
|
let date = NSDate(timeIntervalSince1970: timeInterval)
|
|
let date = NSDate(timeIntervalSince1970: timeInterval)
|
|
let dfmatter = DateFormatter()
|
|
let dfmatter = DateFormatter()
|
|
// yyyy-MM-dd HH:mm:ss
|
|
// yyyy-MM-dd HH:mm:ss
|
|
- dfmatter.dateFormat = "M月d日"
|
|
|
|
- return dfmatter.string(from: date as Date)
|
|
|
|
|
|
+ dfmatter.dateFormat = "yyyy年M月d日"
|
|
|
|
+
|
|
|
|
+ var dfmatterStr = dfmatter.string(from: date as Date)
|
|
|
|
+
|
|
|
|
+ let currentDF = DateFormatter()
|
|
|
|
+ // yyyy-MM-dd HH:mm:ss
|
|
|
|
+ currentDF.dateFormat = "yyyy"
|
|
|
|
+ let currentDFStr = currentDF.string(from: Date())
|
|
|
|
+ if dfmatterStr.hasPrefix(currentDFStr) {
|
|
|
|
+ dfmatterStr.removeFirst(currentDFStr.count + 1)
|
|
|
|
+ }
|
|
|
|
+ return dfmatterStr
|
|
}
|
|
}
|
|
|
|
|
|
/// 判断字符串或者字典是否为空
|
|
/// 判断字符串或者字典是否为空
|