Share via


CreatedTime Property of the IFPCEEPolicy Interface

The CreatedTime property gets a Date value (DATE value in C++) that specifies the date and time in Coordinated Universal Time (UTC) when the enterprise policy was created.

C++

HRESULT get_CreatedTime(
    DATE* pdCreatedTime
);

Parameters

  • pdCreatedTime
    Pointer to a DATE that is set on return to the value specifying the date and time in Coordinated Universal Time (UTC) when the enterprise policy was created.

Return Value

This property method returns S_OK if the call is successful; otherwise, it returns an error code.

Visual Basic

Property CreatedTime As Date

Property Value

Date value that specifies the date and time in Coordinated Universal Time (UTC) when the enterprise policy was created.

Example Code

This VBScript script retrieves the collection of policies defined for the enterprise, iterates through the collection, and displays the names of the policies and the dates and times when they were created.

' Create the root object.
Set root = CreateObject("FPC.Root")
' Declare the other objects needed.
Dim policies       ' An FPCPolicies collection
Dim policy         ' An FPCPolicy object
' Get references to the array object and
' the enterprise policies collection.
Set policies = root.Enterprise.Policies
' List the enterprise policies and the date on which each was created.
WScript.Echo "***Enterprise Policies***"
For Each policy In policies
    WScript.Echo policy.Name & ": " & DateToText(policy.CreatedTime) _
        & " " & TimeToText(policy.CreatedTime)
Next
Private Function DateToText(timeStamp)
    Dim monthStr
    Dim yearStr
    Dim dayStr
    Dim dateVal
    dateVal = CDate(timeStamp)
    monthStr = AddZero(Month(dateVal))    
    dayStr = AddZero(Day(dateVal))
    yearStr = CStr(Year(dateVal))
    DateToText = yearStr & "-" & monthStr  & "-" & dayStr 
End Function
Private Function AddZero(theObj)
    If(Len(CStr(theObj)) < 2) Then
        AddZero = "0" & CStr(theObj)
    Else
        AddZero = CStr(theObj)
    End If
End Function
Private Function TimeToText(timeStamp)
    Dim hourStr
    Dim minStr
    Dim secStr
    Dim dateVal
    
    dateVal = CDate(timeStamp)
    hourStr = AddZero(Hour(dateVal))
    minStr = AddZero(Minute(dateVal))
    secStr = AddZero(Second(dateVal))
    TimeToText = hourStr & ":" & minStr & ":" & secStr
End Function

Remarks

This property is read-only.

Requirements

Client Requires Windows 7 or Windows Vista.
Server Requires Windows Server 2008 R2 or Windows Server 2008 x64 Edition with SP2.
Version Requires Forefront Threat Management Gateway (TMG) 2010.
IDL

Declared in Msfpccom.idl.

DLL

Requires Msfpccom.dll.

See Also

FPCPolicy

Send comments about this topic to Microsoft

Build date: 6/30/2010