DateTime Property

The Active Directory Domain Services schema represents date and time information with the String(Generalized-Time) and String(UTC-Time) syntax types. For more information about the String(Generalized-Time) and String(UTC-Time) syntax types, see "String(Generalized-Time)" or "String(UTC-Time)" in the MSDN Library at https://go.microsoft.com/fwlink/?LinkID=27252.

The System.DirectoryServices namespace uses the DateTime structure to represent these data types. This property type is the equivalent of the ADSI ADSTYPE_UTC_TIME property type. For more information about the ADSTYPE_UTC_TIME property type, see ADSTYPEENUM in the MSDN Library at https://go.microsoft.com/fwlink/?LinkID=27252.

The following example shows how to write a DateTime property on an object.

DateTime newdt = new DateTime(2002, 10, 21, 11, 4, 5, 0);
de.Properties["TestTime"].Value = newdt;
de.CommitChanges();

See Also

Reference

System.DirectoryServices
DateTime

Concepts

Property Types

Send comments about this topic to Microsoft.

Copyright © 2007 by Microsoft Corporation. All rights reserved.