StorageFile.DateCreated Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the date and time when the current file was created.
public:
property DateTime DateCreated { DateTime get(); };
DateTime DateCreated();
public System.DateTimeOffset DateCreated { get; }
var dateTime = storageFile.dateCreated;
Public ReadOnly Property DateCreated As DateTimeOffset
Property Value
The date and time when the current file was created.
Implements
Remarks
DateTime: If the date property isn't set, this value defaults to 0 which can be translated into misleading dates in different programming languages. Microsoft .NET languages do not use this type directly. In .NET it is projected as a
System.DateTimeOffset
. Each language transparently handles the conversion to the granularity and date ranges for the respective language.DateTimeOffset: Because the .NET
DateTimeOffset
is a structure, aDateTimeOffset
object that has been declared but not otherwise initialized contains the default values for each of its member fields. This means that itsDateTime
property is set toDateTimeOffset.MinValue
and itsOffset
property is set toTimeSpan.Zero
. In string format, theDateTimeOffset
that a file was created might be "4/18/2020 3:13:50 PM".
You should always check that this property is a real value and is not set to the default value.