Share via


IVSSVersion.Date Property 

Gets the date and the time of the creation of the file or project version.

Namespace: Microsoft.VisualStudio.SourceSafe.Interop
Assembly: Microsoft.VisualStudio.SourceSafe.Interop (in microsoft.visualstudio.sourcesafe.interop.dll)

Syntax

'Declaration
ReadOnly Property Date As DateTime
'Usage
Dim instance As IVSSVersion
Dim value As DateTime

value = instance.Date
DateTime Date { get; }
property DateTime Date {
    DateTime get ();
}
/** @property */
DateTime get_Date ()
function get Date () : DateTime

Property Value

The date and the time of the creation of the file or project version.

Remarks

[IDL]

HRESULT Date ([out,retval]DATE *pDate);

Example

The following example demonstrates how to iterate through the IVSSVersions collection of a file and display the Date property for each version.

using System;
using Microsoft.VisualStudio.SourceSafe.Interop;

public class IVSSTest
{
    public static void Main()
    {
        string testFile = "$/A/test.txt";

        // Create a VSSDatabase object.
        IVSSDatabase vssDatabase = new VSSDatabase();

        // Open a VSS database using network name 
        // for automatic user login.
        vssDatabase.Open(@"C:\VSSTestDB\srcsafe.ini", 
                         Environment.UserName, ""); 

        Console.WriteLine("\n$/A/test.txt versions: \n");
        Console.WriteLine("-------------------------------------------------------");
        Console.WriteLine("{0,-4}{1,-14}{2,-15}{3,-16}", 
                          "Ver", "Comment", "Action", "Date");
        Console.WriteLine("-------------------------------------------------------");
        IVSSItem vssFile = vssDatabase.get_VSSItem(testFile, false);
        foreach(IVSSVersion vssVersion in vssFile.get_Versions(0))    
            Console.WriteLine("{0,-4}{1,-14}{2,-15}{3,-16}", 
                              vssVersion.VersionNumber, vssVersion.Comment, 
                              vssVersion.Action, vssVersion.Date);
        Console.WriteLine("-------------------------------------------------------");
    }
}

Output:

$/A/test.txt versions:

-------------------------------------------------------
Ver Comment       Action         Date
-------------------------------------------------------
14                Labeled 'Lbl1' 11/8/2003 12:41:12 PM
3   Ver 3         Checked in $/A 11/4/2003 10:47:30 PM
2   Ver 2         Checked in $/A 11/4/2003 10:46:48 PM
1                 Created        11/4/2003 10:45:52 PM
-------------------------------------------------------

See Also

Reference

IVSSVersion Interface
IVSSVersion Members
Microsoft.VisualStudio.SourceSafe.Interop Namespace