DESCRIPTION:
Stores in ProcessValue the current system date, the format will depend on what is specified in Factor.
Possible Factor values:
- Year: Returns the current year
- ShortDate: Returns the current date in the following format 03/12/2022
- DateTime: Returns the current date in the following format 03/12/2022 11:30:33:33
- Time: Returns the current time in the following format 11:30:33
- DateFormat: Returns the current date with the following format "yyyy-MM-dd HH:mm:ss".
- ShortDate1: Returns the current date with the following format "yyyy-MM-dd".
- ProcessedValue = CDate(SourceValue).ToShortTimeString
- LongDate: Returns the current date with the following format 03/12/2022 11:30:33:33
EXAMPLE:
Source value: "03/12/2022".
Factor: "DateFormat
Value Processed: "03-12-2022".
CONFIGURATION:
Value | Value2 | Relation | Relationship2 | Operation | Factor |
DateCurrent | DateLong | ||||
CODE:
Select Case Factor
Case "Year
ProcessedValue = CDate(Now).Year
Case "ShortDate" Case "ShortDate" Case "ShortDate" Case "ShortDate" Case "ShortDate
ProcessedValue = CDate(Now).ToShortDateString
Case "DateTime"
ProcessValue = CDate(Now)
Case "Time
Dim currentTime As Date
currentTime = TimeOfDay
ProcessValue = currentTime
Case "DateFormat"
ProcessValue = Format(Now, "yyyy-MM-dd HH:mm:ss")
Case "ShortDate1" Case "ShortDate1" Case "ShortDate1
ProcessValue = Format(Now, "yyyy-MM-dd")
Case "LongDate" Case "LongDate" Case "LongDate" Case "LongDate" Case "LongDate
ProcessValue = Convert.ToDateTime(Now).ToString
End Select