YNMFormattedDate iOS Swift
如何转换日期格式,例如从dd/MM/YYYY转换为MMM dd, yyyy
示例
要运行示例项目,请克隆仓库,并首先在示例目录中运行pod install
。
需求
- Swift 3
- iOS 8.0+
安装
YNMFormattedDate可通过CocoaPods获取。要安装它,只需将以下行添加到Podfile中
pod 'YNMFormattedDate'
使用
将YNMFormattedDate添加到您的项目中。参考http://docs.onemobilesdk.aol.com/ios-ad-sdk/adding-frameworks-xcode.html
import YNMFormattedDate
var formatDate = YNMFormattedDate()
let dateNow = self.formatDate.formattedDateFromString(dateFormat: "dd/MM/yyyy", dateString: "24/06/2018", withFormat: "MMM dd, yyyy")
print("today is => \(String(describing: dateNow))")
作者
killme3, [email protected]
许可证
YNMFormattedDate 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。