Quantcast
Viewing all articles
Browse latest Browse all 6517

New Post: GetVersionCollection with DateTime colum returns value one day off!

Hi, 

Thanks for your replies.

Mark - yes, I realize that SPServices is simply returning the value from the webservice - but I thought this would be the best place for the discussion. 

The timezone in the regional settings on all servers I tested this on was BST. I also tested this on my clients dev server - again seems to be BST - and had the same issue.

I tracked this down to a problem in rounding the date. You see the date value in the column was provided by a date control, with "00:00:00" concatenated onto the ending in JS, as the updatelistitems service appeared to require a time portion to the date stamp.

Now the GetVersionCollection service was rounding this time differently, depending on whether the date was in the past, or the future. A stored value of :

01/01/2012 00:00:00 (in the past) would be returned by the getversioncollection as 01/01/2012

A stored value of 18/10/2012 00:00:00 (in the future) would be returned as 19/10/2012 - one extra day in the future.

To fix this, I simply concatinate a less dubious timestamp onto the value I send to updatelistitems: 18/10/2012 05:00:00.

This avoids the rounding issue, and my problem - but doesn't really explain the bug in the webservice.

Mike

 

 

 

 

 


Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>