Date and Time

Below is part of a Program that is putting my date in as when the program was made thru NX, Is there something here that I can replace to make the time current of when the Program was ran.

attributePropertiesBuilder5.DateValue.DateItem.Day = DateItemBuilder.DayOfMonth.Day25

attributePropertiesBuilder5.DateValue.DateItem.Month = DateItemBuilder.MonthOfYear.Oct

attributePropertiesBuilder5.DateValue.DateItem.Year = "2017"

attributePropertiesBuilder5.DateValue.DateItem.Time = "00:00:00"

I do not need the Time Just The Date.

Below is a snippet of code that applies the current date and time to the attribute properties builder. The basic idea is to query the system date and time then translate that to the format that the NXOpen API uses. The "Now" keyword gets the system date/time, we then use various properties (.Day, .Month, etc) to break it up into useable chunks for the NXOpen API.

Dim myDateTime As DateTime = Now

Dim attributePropertiesBuilder2 As AttributePropertiesBuilder
attributePropertiesBuilder2 = theSession.AttributeManager.CreateAttributePropertiesBuilder(workPart, objects1, AttributePropertiesBuilder.OperationType.None)
With attributePropertiesBuilder2
.IsArray = False
.DataType = AttributePropertiesBaseBuilder.DataTypeOptions.Date
.Category = "SlackDim"
.Title = "LastUpdated"
.DateValue.DateItem.Day = myDateTime.Day - 1
.DateValue.DateItem.Month = myDateTime.Month - 1
.DateValue.DateItem.Year = myDateTime.Year.ToString
.DateValue.DateItem.Time = myDateTime.ToString("HH:mm:ss")
Dim nXObject7 As NXObject
nXObject7 = .Commit()
.Destroy()
End With