Date.Now 方法
获取当前的系统日期和时间,格式为 ISO (YYYY-MM-DDThh:mm:ss)。
命名空间: Microsoft.Office.Interop.InfoPath.SemiTrust
程序集: Microsoft.Office.Interop.InfoPath.SemiTrust(位于 Microsoft.Office.Interop.InfoPath.SemiTrust.dll 中)
语法
声明
Function Now As Object
用法
Dim instance As Date
Dim returnValue As Object
returnValue = instance.Now()
Object Now()
返回值
类型:System.Object
一个表示当前日期和时间的 object。
备注
重要
可以无限制访问此成员。
示例
在以下示例中,currentDateTime 变量设置为当前的系统日期和时间:
object currentDateTime = thisXDocument.Util.Date.Now();
thisXDocument.UI.Alert(currentDateTime.ToString());