Microsoft Sync Framework Toolkit iPhone example - date format wrong?

你离开我真会死。 提交于 2019-12-11 20:17:59

问题


I am currently having trouble with upload in the sample - doesn't work with below error message "Invalid Date Time value received."

It seem to be complaining about how the date is formatted as string - yyyy-MM-ddTHH:mm:ss.SS is how the iPhone sample code originally formatted it to, changed it to yy-mm-ddTHH:mm:ss:SSS as said in HTML5 example inline documentation, and few other formats, but no luck.

What is the correct format?


Here're what I've done to get the sample to work for download part...

As instructed, I have changed the URI in plist file.

Looking at HTML5 example, I realized the URL for webservice was in wrong format, so changed them as below..

 //self.uploadURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/DefaultScopeSyncService.svc/?syncScope=DefaultScope&operation=UploadChanges&userid=%@", self.baseURL, [anc valueForKey:@"userID"]]];
 self.uploadURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/DefaultScopeSyncService.svc/defaultscope/UploadChanges?userid=%@", self.baseURL, [anc valueForKey:@"userID"]]];     

 //self.downloadURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/DefaultScopeSyncService.svc/?syncScope=DefaultScope&operation=DownloadChanges&userid=%@", self.baseURL, [anc valueForKey:@"userID"]]];
 self.downloadURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/DefaultScopeSyncService.svc/defaultscope/DownloadChanges?userid=%@", self.baseURL, anc.userID]];

回答1:


In case this helps someone else...

Found the format that works. yyyy-MM-ddTHH:mm:ss.SSSSSSS
The time format conversion seem to be done in Formatters/FormatterUtilities.cs file



来源:https://stackoverflow.com/questions/13169754/microsoft-sync-framework-toolkit-iphone-example-date-format-wrong

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!