DateTime 属性

Active Directory 域服务架构用 String(Generalized-Time) 和 String(UTC-Time) 语法类型表示日期和时间信息。有关 String(Generalized-Time) 和 String(UTC-Time) 语法类型的更多信息,请参见位于 https://go.microsoft.com/fwlink/?LinkID=27252 上的 MSDN Library 中的“String(Generalized-Time)”或“String(UTC-Time)”(可能为英文网页)。

System.DirectoryServices 命名空间使用 DateTime 结构表示这些数据类型。此属性类型等效于 ADSI ADSTYPE_UTC_TIME 属性类型。有关 ADSTYPE_UTC_TIME 属性类型的更多信息,请参见位于 https://go.microsoft.com/fwlink/?LinkID=27252 上的 MSDN Library 中的“ADSTYPEENUM”(可能为英文网页)。

下面的示例说明如何对某一对象写入 DateTime 属性。

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

另请参见

参考

System.DirectoryServices
DateTime

概念

属性类型

Send comments about this topic to Microsoft.

版权所有 (C) 2007 Microsoft Corporation。保留所有权利。