This document is archived and information here might be outdated.  Recommended version.


IDatasetNameFileStat.StatTime Property (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (GeoDatabase)  

IDatasetNameFileStat.StatTime Property

The date modified/created/accessed.

[Visual Basic .NET]
Public Function get_StatTime ( _
    ByVal dateMode As esriDatasetFileStatTimeMode _
) As Integer
[Visual Basic .NET]
Public Sub set_StatTime ( _
    ByVal dateMode As esriDatasetFileStatTimeMode, _
    ByVal pTime As Integer _
)
[C#]
public int get_StatTime (
    esriDatasetFileStatTimeMode dateMode
);
[C#]
public void set_StatTime (
    esriDatasetFileStatTimeMode dateMode,
    int pTime
);
[C++]
HRESULT get_StatTime(
  esriDatasetFileStatTimeMode dateMode,
  long* pTime
);
[C++]
HRESULT put_StatTime(
  esriDatasetFileStatTimeMode dateMode,
  long pTime
);
[C++]

Parameters dateMode [in]
dateMode is a parameter of type esriDatasetFileStatTimeMode pTime [out, retval] pTime is a parameter of type long dateMode [in]
dateMode is a parameter of type esriDatasetFileStatTimeMode pTime [in] pTime is a parameter of type long

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

The time is set and returned as the number of seconds since 12:00:00, 1 January 1970 UTC.

[C#]

To convert the type of value returned from this method to a .NET DateTime struct, a function like the following can be used:

public DateTime GetFileCreationTime(IName name)
{
  IDatasetNameFileStat datasetNameFileStat=(IDatasetNameFileStat)name;
  int ticks=datasetNameFileStat.get_StatTime(esriDatasetFileStatTimeMode.esriDatasetFileStatTimeCreation);
  DateTime baseTime=new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
  DateTime fileTime=baseTime.AddSeconds(ticks);
  return fileTime.ToLocalTime();
}

See Also

IDatasetNameFileStat Interface