SP.ListItem.File.Versions (FileVersionCollection) has wrong Created date/time?

I'm trying to use CSOM to get info about old versions of list items. But while I can retrieve the FileVersionCollection (File.Versions) fine, the only info it gives me for each version is the ID/Label/Created/CreatedBy/Url. It doesn't give me any other field
values.
I know I can get this info using lists.asmx/GetVersionCollection, but that API only returns the specified field value, Modified and ModifiedBy for each version.
That would be OK if the Modified timestamp matched the Created timestamp returned in the FileVersionCollection, but it doesn't, and in fact, the Created field of FileVersion seems to be simply incorrect in many cases.  For instance, when I look at the
version history page for one item I see:
2.0  
 1/15/2015 4:35 PM   Edit 
 Administrator  < 1 KB   
1.0  
 1/12/2015 4:30 PM   Edit 
 Administrator  < 1 KB  
But File.Versions has:
3.0  1/15/2015  5:33:49 AM
2.0  1/12/2015 5:18:11 AM
1.0  1/12/2015 5:18:11 AM
Obviously the latter is in the UTC, but even converted to local time, the timestamps don't correspond at all. Nor do I understand why there are three entries (I assume 3.0 is the 'latest' version that the version history screen doesn't show, but it's reported
'Created' date is before the date of version 2).
GetVersionCollection in comparison returns:
<Version Departments=";#Sales;#Development;#" Modified="2015-01-15T05:35:48Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
<Version Departments=";#Development;#Sales;#" Modified="2015-01-15T03:55:07Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
<Version Departments=";#Development;#Sales;#" Modified="2015-01-12T05:30:06Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
Where the 3rd entry would seem to be version 1.0 (512), and the first entry the latest version, but the middle entry has a completely different date that doesn't correspond to anything else!
And yes I'm absolutely sure these are all for the same item.
BTW if I specify "Created" as the field for GetVersionCollection, I just get the same Created date for all 3:
1/12/2015 5:15:48 AM - a completely new date that doesn't correspond to anything else at all!
For kicks I just tried it with the "Version" field, and now I get:
<Version Version="4.0" Modified="2015-01-15T05:35:48Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
<Version Version="3.0" Modified="2015-01-15T05:33:49Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
<Version Version="2.0" Modified="2015-01-15T03:55:07Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
<Version Version="1.0" Modified="2015-01-12T05:30:06Z" Editor="1;#Administrator,#i:0#.w|sp2013dev\administrator,#,#,#Administrator" />
Well I suppose technically that now gives me enough info to locate the right version, but talk about convoluted...then I still have to figure out how to parse the field value (which in this case is a multi-choice field, but I need to support all field types).

Hi,
Please check the code as below, it working fine in my test environment.
public DataTable GetDoucmentHistory(string listName, int id)
using (ClientContext ctx = GetClientContext())
var file = ctx.Web.Lists.GetByTitle(listName).GetItemById(id).File;
var versions = file.Versions;
ctx.Load(file);
ctx.Load(versions);
ctx.Load(versions, vs => vs.Include(v => v.CreatedBy));
ctx.ExecuteQuery();
var ds = CreatHistoryDataSet();
foreach (FileVersion fileVersion in versions)
var row = ds.Tables[0].NewRow();
row["CreatedBy"] = fileVersion.CreatedBy.Title;
row["Comments"] = fileVersion.CheckInComment;
fileVersion.Created.ToUniversalTime();
row["Created"] = fileVersion.Created.AddHours(-8).ToShortDateString() + " " +
fileVersion.Created.AddHours(-8).ToShortTimeString();
row["Title"] = file.Title;
row["VersionLabel"] = fileVersion.VersionLabel;
row["IsCurrentVersion"] = fileVersion.IsCurrentVersion;
ds.Tables[0].Rows.Add(row);
DataView view = ds.Tables[0].DefaultView;
view.Sort = "VersionLabel DESC";
DataTable sortedTable = view.ToTable();
return sortedTable;
private static System.Data.DataSet CreatHistoryDataSet()
DataSet ds = new DataSet();
DataTable table = new DataTable();
table.Columns.Add("Title");
table.Columns.Add("Created");
table.Columns.Add("CreatedBy");
table.Columns.Add("EncodedAbsUrl");
table.Columns.Add("VersionLabel");
table.Columns.Add("Comments");
table.Columns.Add("IsCurrentVersion");
ds.Tables.Add(table);
return ds;
To get all versions of version field you just need to call GetVersionCollection method on version field by passing it's internal name
_UIVersionString
Simple code snippet:
ListProxy.Lists lists = new Lists();
lists.UseDefaultCredentials = true;
XmlNode versions = lists.GetVersionCollection("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx}",
"n", "_UIVersionString");
foreach(XmlNode version in versions.ChildNodes)
Console.WriteLine(version.Attributes["_UIVersionString"].Value);
More information is here:
http://sharepoint.stackexchange.com/questions/27346/how-to-programmatically-retrieve-item-version-history-from-client
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected].
Dennis Guo
TechNet Community Support

Similar Messages

  • Finder and wrong Created dates/times

    I've noticed this glitch in Tiger and Snow Leopard, and it has remained in Lion.  When I have a Finder window open (whether in List or Column view), I notice that a number of files show the Created date and time as 12-31-69 5:00 PM.  Even if I check the file info (Command-I), I get the same results.  Yet when I import a photo file with such a date/time into say Aperture or Lightroom, for example, the original created date is proper, which tells me that my Mac isn't corrupting this information, it's just not rendering it properly in Finder.
    Anyone else having this problem with Finder?  More importantly, does anybody know if there is a fix for this?

    Copying files from a backup should not alter the created/modified dates, I just tested that.
    Why don't you try a TM restore on one of the files and see if it works.

  • How to change the "content created" date/time in FCPX?

    Since I've had problems importing my whole iMovie event library into FCPX I decided to run some tests with importing individual files (part of iMovie events and originally imported from camera into iMovie). Some of them for some reason got the wrong "content created" date/time in them while in iMovie they have the right date/time set. Does anybody have an idea on how to change the "content created" timestamp?

    I had a bunch of DV files that imported stamped with the file modification date and time.  I did not find a way to change it in FCPX. With FCPX not running, I used A Better Finder Attributes to modify the creation and modification dates of the files in the event folder. FCPX reconnected to them but the event still showed the old range of dates so I created a new event and moved the clips to it. Maybe ther is a beter way but that is how I did it.

  • Get Sale order created date & time

    Hello.
        Can anybody help me in finding the function module which takes sale order no. as input & gives me the order created date & time as output.
    Regards
    Devika.S

    In Table VBAK,  you can see both these fields
    1)  ERDAT:::::Created date
    2)  ERZET::::::Created time
    thanks
    G. Lakshmipathi

  • Table & Field's Created Date & Time details

    Hi all
    I have a table Name as Emp with Attributes as Empid,ename,esal
    Now am getting Table Created Date from the view "user_objects"
    But i want to know the Field's Created Data & Time by query?
    Can any give a solution?
    Thanks in advance..

    Frank Kulash wrote:
    Hi,
    I don't believe Oracle automatically keeps that anywhere.Am also getting to know the DDL Performed time by the help of "dba_objects"
    select to_char(created,'YYYYMMDD HH24:MI:SS'), to_char(LAST_DDL_TIME,'YYYYMMDD HH24:MI:SS') from dba_objects where object_name='Emp';
    By the above query am getting that some field is changed, but am not getting exactly which field i.e Attribute got changed...

  • Has anyone created a time-lapse video with Final Cut Pro X?

    I've taken a series of 2,631 I'd like to create a time-lapse video from. The process has been excruciating so far. I'm getting tons of spinning beachballs. I'm running Lion, 10.7.1.
    Before I do any more hair pulling, has someone else out there successfully used FCP X for creating time-lapse videos? Any tips you can offer?

    I love using FCPX for time lapse movies, here is an example:
    http://vimeo.com/27460065
    My workflow is as follows:
    1. I import the photos to QT player 7 as an image sequence
    2. I save the resulting movie in QT7 in Prores HQ, keeping the original movie size (eg. 3500x1940)
    3. I import the movie to a 1920x1080 project in FCPX.
    4.  I can now easily create pans and zoom ins without losing quality.
    I hope this helps.
    Izhar

  • Refurbished iPod Touch didn't come with warranty, has wrong purchase date

    So I bought a refurbished iPod Touch 5G a couple of weeks ago (in September). For some reason the serial number for the iPod shows up as being out of warranty and also states that it was purchased in May. Has anyone else ever had issues with the warranty and purchase date info being mixed up for their refurb? It became an issue for me because the iPod's screen was flickering. I took it to the Apple store, where they could see that the records were incorrect, but could do nothing about it. They replaced the iPod and zeroed out the replacement fee so it didn't cost me anything, but my iPod still officially lacks a warranty and has the wrong purchase date associated with it. I wish I knew who to talk to to get this cleared up.
    I should add that I bought my iPod from the online Apple store, so this is all within their system.
    Message was edited by: ekalter

    Kappy,
    Thanks for you reponse. The serial number for my iPod brought up the following information at the Apple store:
    Warranty Status: Out of Warranty(OW)
    Model: IPOD TOUCH (5TH GENERATION)
    Date of Purchase: 06-May-13
    ...but I ordered the iPod online on September 21st. They had to bypass their system in order to give me my free replacement. I'm concerned that if I have a problem again in the future I will not get my 1 year of warranty coverage. It seems to me like someone failed to change some information associated with this iPod when they processed my order for the refurbished model.

  • I cannot open a file *.pages which has been created few days ago

    Hi All,
    2 weeks ago I created a document with extension *.pages. I sent it to my private email box and today I downloaded it.
    When I am trying to open it, it gives me an error that this file cannot be opened.
    What happened?
    How I can open this file?
    Thanks in advance
    Alex

    what error do you get?

  • How do I know what PAL version CS4 has just created for me?

    And where do I get the appropriate PAL logo to go on my DVD series I've just produced.
    Do I need the Dolby Digital Sound Logo? An ISBN barcode?
    Now that I'm doing the slick there are suddenly a whole lot of questions I don't have answers for.
    I'm from New Zealand if that helps for specific information.
    Help.  Our deadline is coming up real fast.

    You mean this: http://www.fusecon.com/pubs/txtfiles/dvdstuff/ADALOGODEMO.pdf
    You can download them here: http://www.fusecon.com/pubs/txtfiles/DVDCreation.htm
    Google is your friend.

  • How to make file versioned automatically when it is created

    I am wondering it is possible to use the server side override to make file versioned when it is created. Does anyone have code to do it? Thanks a lot,
    Jean

    It might be possible. The difficult part is moving all the object creation code into an override. I did it by creating a new parser that always creates new documents as versioned (among other things) and have found that to work very well.

  • Photoshop CC on Windows 7 is saving the file "date" as the created date not the modified date

    I have been using a much older version of PS (CS2) and just decided to update to PS CC. I have installed the trial version of PS CC and will begin the CC subscription as soon as the trial expires.
    I have noticed that PS CC saves the (main) date of the files as the "created date" not the "modified date" as it pertains to Windows Explorer and the Windows OS.
    Here is what is happening: I have a file that I created in 2007 that I use for a template. It is sized to specific dimensions, etc. and when I do my save as, it automatically saves into the desired file folder, so that's why I use this as a template. I setup a new photo and then drag and drop it into my template, flatten the image and save as. When doing this with PS CS2, the date for the newly saved file was assigned as the modified date (current date and time). So, when I searched for the file in Windows Explorer or when I went to open the file, the date shown for the file was the modified date. NOW, with PS CC when I perform the exact same process and do a save as, the file date shown in Windows Explorer and/or when I go to open the file is showing as the created date (3/9/2007), the date that I created and saved the template I use. This is aggravating to me because now when I want to open a file and sort by date, the date shown in Windows Explorer is not accurate. As far as I can tell, this only happens in PS CC. When I open an old file with ID CC and do a save as, it applies the current date, not the created date. And, when I was using PS CS2, whenever I did a save as the current date was applied as well.
    In summary, when performing a save as, the created date is being applied as the main date instead of the modified date. The question is: Is there a way to change this so that the modified date can be applied as the main date for the file when performing a save as?

    Below are two files created the exact same way on the exact same computer: the top one was saved in PS CS2 and the bottom one was saved in PS CC. Both were saved using the "Save As" command. You will notice that when the "Save As" command was used in CS2 it updated the "Created:" date, however, in the CC version the "Created:" date was not updated, only the "Modified:" date was updated. Is there a way to update the "Created:" date when performing a "Save As" in PS CC?

  • Need to add date/time stamp to file name without time change creating new files

    We have setup our application to save data once a trigger event occurs. We also need the date/time stamp as part of the file name. We used Format Date/Time String and concatenated it into the file name. It all works good, but as the time changes (seconds, minutes, etc.) it causes the Write to File to create a new file with the new filename. Is there a way to create the file and save/latch/buffer the time in the file name so that it doesn't create a new file for every second?
    I've attached a shot of the relevant part of our VI. It's all in a big while loop. The data save is in a case/switch so that when it is triggered it starts saving. (The for loop is to split the data up
    into 4 different files). Like I said, it all works except new files are created every second as the time changes instead of just putting it all in one file with the initial time in the file name.
    Attachments:
    TimeInFileNameQuestion.jpg ‏46 KB

    I need a loop in order to use a shift register. I cannot stop the outer while loop (because it would stop the hardware from collecting data), and I cannot add loops inside which bogs down the processor to where the app stops. I've attached a simpler version of my VI which illustrates the problem. While the button is pressed (the trigger) it should save the data (in this case just cycle numbers) into one file with the initial date/time. But, you can see that it creates 1 file/second. I tried using shift registers, but without adding extra loops I can't see how to do it. Thanks
    Attachments:
    FileNameTest.vi ‏29 KB

  • File Versioning in Leopard

    Im building a new company and we've already standardized on Macbooks and we're loving it. We're now considering getting an Xserve.
    One of our requirements is file versioning. It looks like with time machine, this will be available on the client side when leopard comes out. Can anyone advise if there will be a similar feature on network stores?
    If not, then our next best hope is that a tool like alfresco will build integration into Spotlight server! I'll have to ask those guys if that is in the works.
    Thanks for any advice you can give. We dont want to invest in the wrong infrastructure!
    MacBook Pro 2.0ghz Mac OS X (10.4.6)

    For a non-authoritative answer to the "Time Machine" question, see http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleI d=9005730&pageNumber=2
    XServe   Mac OS X (10.4.8)  

  • Table For Purchase Order Version Number and Version Created Date

    Dear Sir,
    Whenever we make any change in Purchase Order , then a new Version Number  along with Created Date is assigned . In Me23n the Version Number and It's Created date is also displayed ( at PO Header Level) .
    We request you to kindly guide us as which Table is required to be reffered to get the Version Number and Version Created date  for the Purchase Order .
    With Thanks and Rgds
    Sonia

    Hi
    Check in EKKO - Purchase order header
    EKPO - Purchase order item
    CDHDR
    CHPOS
    Regards
    Ram
    Edited by: Parasuram M on Sep 16, 2009 11:59 AM

  • To know the actual date & time for created versions in cprojects

    HI ABAPers,
    Am working on cproject version 3.1,  wanted to know where the  exact date & time  is getting captured when a version i.e
    con H & base  versions is created in cprojects ( collaboration projects ).
        Already i have checked in  dpr_project table where versions are getting stored with the same project created date & time. But not with the actual date & time when the versions were created. 
    is there any BAPI or table where we can know the actual date & time of the created versions.
    Thank you!!!
    Abdul

    Hi,
    According to your post, my understanding is that you want to change date format for ‘Created’ field in the getVersions web service.
    Per my knowledge, you can get the date format for ‘Created’ field as “MM/dd/yyyy HH:mm a”.
    For more information, you can refer to:
    Versions.GetVersions Method (Versions)
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

Maybe you are looking for

  • Yoga 2 Pro touchpad not recognized as precision touchpad on Windows 10

    Hi all, I was really delighted to see Synaptics drivers being available for the Yoga 2 Pro for Windows 10 on your site yesterday. However, I am really confused to see that the Yoga 2 Pro touchpad is not recognized as a precision touchpad. Does the ha

  • Error transferring datasource in R/3

    Hello I am trying to transfer a datasource from R/3 to BW.I am planning to transfer and then replicate When i go in RSA5 in R/3 and when i select the source and then click on Transfer it gives me error.the error is "The datasource is not assigned to

  • How to display full filename

    Sorry, I know it was talked about before but I can't find it. How do you get Aperture to display the full filename under the photo in grid or other view's that includes .nef or .jpg? PowerBook G4   Mac OS X (10.4.6)  

  • What gives Apple, I can't open a CVS file!?

    So I download a CVS file from my online banking and go to open it with my new version of numbers, and the formating is out and the cell format for currency have not been preserved. It was a simple matter to correct, a couple of highlighted columns an

  • HT1212 i can't remember my passcoad for my ipod touch and is been locked what i can do?

    can you please help me i can't remember the passcoad for my ipod touch what should i do?