Microsoft Sync Framework Toolkit iPhone 示例 - 日期格式错误? [英] Microsoft Sync Framework Toolkit iPhone example - date format wrong?

查看:41
本文介绍了Microsoft Sync Framework Toolkit iPhone 示例 - 日期格式错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在上传示例时遇到问题 - 不适用于以下错误消息收到的日期时间值无效".

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

似乎在抱怨如何将日期格式化为字符串 - yyyy-MM-ddTHH:mm:ss.SS 是 iPhone 示例代码最初将其格式化为的方式,将其更改为 yy-mm-ddTHH:mm:ss:SSS 如 HTML5 示例内联文档中所述,以及其他一些格式,但没有运气.

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.

正确的格式是什么?


以下是我为使示例适用于下载部分所做的工作...


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

按照指示,我已经更改了 plist 文件中的 URI.

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

查看 HTML5 示例,我意识到 webservice 的 URL 格式错误,因此将它们更改如下..

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]];

推荐答案

如果这对其他人有帮助...

In case this helps someone else...

找到了有效的格式.yyyy-MM-ddTHH:mm:ss.SSSSSSS
时间格式转换好像是在 Formatters/FormatterUtilities.cs 文件中完成的

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

这篇关于Microsoft Sync Framework Toolkit iPhone 示例 - 日期格式错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆