[英]NSDateFormatter date format for "3/31' 0" date string?
I am trying to convert @"3/31' 0"
string to date using NSDateFormatter
, but none of the formats I have tried can't convert this string to NSDate
.我正在尝试使用NSDateFormatter
将@"3/31' 0"
字符串转换为日期,但我尝试过的任何格式都无法将此字符串转换为NSDate
。
I have try different combinations of M, MM, D, DD, Y, YY, YYY, but no luck.我尝试了 M、MM、D、DD、Y、YY、YYY 的不同组合,但没有运气。
Can someone, please, point me to correct date format.有人可以请指出我正确的日期格式。
Edit: correct format for this string should be "day/month' year"
but I cant express this using NSDateFormatter
format specification.编辑:此字符串的正确格式应为"day/month' year"
但我无法使用NSDateFormatter
格式规范来表达这一点。
Thanks谢谢
Its not possible to convert @"3/31' 0" string to date, at least using Georgian calendar, because there is no 0 year in Georgian calendar - Apple docs .无法将 @"3/31' 0" 字符串转换为日期,至少使用格鲁吉亚日历是不可能的,因为格鲁吉亚日历中没有 0 年 - Apple docs 。
Ie @"3/31' 0" is an invalid date string.即@"3/31' 0" 是无效的日期字符串。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.