StorageFile.DateCreated Property
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
The date and time when the current file was created.
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.
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |