【发布时间】:2011-09-24 07:48:41
【问题描述】:
currentDateTime = [NSDate date];
dateFormatter = [[NSDateFormatter alloc]init] ;
[dateFormatter setDateFormat:@"yyyy-mm-dd hh:mm"]; // 1999-12-12 14:50
dateInString = [dateFormatter stringFromDate:currentDateTime];
metTime.text=dateInString;
NSLog(@"date %@", dateInString);
我尝试将当前时间作为字符串参数发送到 Web 服务方法。我可以看到它,但是当传递 dateInString 时出现错误,例如
System.Web.Services.Protocols.SoapException:服务器无法处理请求。 ---> System.FormatException:字符串未被识别为有效的日期时间。 在 System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles 样式) 在 System.Convert.ToDateTime(字符串值) 在 MrkService.MrkService.AddMeetingInfo(String phoId, Int32 metId, Int32 cusId, Int32 metTyp, Int32 metRes, String desc, String contc, String endTime) --- 内部异常堆栈跟踪结束 ---
有没有人知道这个问题(web服务方法参数是字符串不是日期)
【问题讨论】:
标签: objective-c ios xcode datetime nsdate