To give you an example here's the confusion:
11/11/2001. Is this American date format or English? well my answer is, I don't know? But if you try to parse this value using default culture of your machine you wont get any format exception. But you'll get with 11/13/2001 if your code doesn't take datetime format into account and is running on UK machine.
There's a limited set of information available with webs.asmx. When you try to retrieve using GetWeb method all you get is the language Id. Which is by default to 1033.
What if your regional settings are set to UK and your code queries all list items using lists.asmx web service. The datetime is going to be in UK format especially for created and modified fields.
So to fix this issue you would need to take the Regional Settings into account.
How to retrieve regional settings - using Sharepoint Web Services:
The only way I found to retrieve the regional settings of a web via web services is using a lists schema and by reading the element value i.e: RegionalSettings -> Locale ....
Let me know if you need the code examples.
Hope this will help !
Majid
1 comment:
Thanks for sharing this Majid. In your tests, did you find the Locale in the response to be different in the cases where the Dates come back in the dd/mm/YYYY format for example? I was wondering if one could lean on the locale to determine what datetime format to expect in the GetListItems response.
Post a Comment