TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Oct 2017 |
Maintained by CoderZhuXH.
导入 #import "NSString+XHDateFormat.h" 直接掉用下面方法转换为需要格式
self.timeString = @"2017-04-16 13:08:06";
//星期
NSString *time0 = self.timeString.xh_formatWeekDay;
//2017年04月16日
NSString *time1 = self.timeString.xh_formatNianYueRi;
//2017年04月
NSString *time2 = self.timeString.xh_formatNianYue;
//04月16日
NSString *time3 = self.timeString.xh_formatYueRi;
//2017年
NSString *time4 = self.timeString.xh_formatNian;
//13时08分01秒
NSString *time5 = self.timeString.xh_formatShiFenMiao;
//13时08分
NSString *time6 = self.timeString.xh_formatShiFen;
//08分01秒
NSString *time7 = self.timeString.xh_formatFenMiao;
//2017-04-16
NSString *time8 = self.timeString.xh_format_yyyy_MM_dd;
//2017-04
NSString *time9 = self.timeString.xh_format_yyyy_MM;
//04-16
NSString *time10 = self.timeString.xh_format_MM_dd;
//2017
NSString *time11 = self.timeString.xh_format_yyyy;
//13:08:06
NSString *time12 = self.timeString.xh_format_HH_mm_ss;
//13:08
NSString *time13 = self.timeString.xh_format_HH_mm;
//08:06
NSString *time14 = self.timeString.xh_format_mm_ss;
XHDate 使用 MIT 许可证,详情见 LICENSE 文件