DESCRIPCIÓN:
Guarda en ValorProcesado la fecha actual del sistema, el formato dependerá de lo indicado en Factor.
Valores posibles de Factor:
- Año: Devuelve el año actual
- FechaCorta: Devuelve la fecha actual con el siguiente formato 03/12/2022
- FechaHora: Devuelve la fecha actual con el siguiente formato 03/12/2022 11:30:33
- Hora: Devuelve la hora actual con el siguiente formato 11:30:33
- FechaFormato: Devuelve la fecha actual con el siguiente formato “yyyy-MM-dd HH:mm:ss”
- FechaCorta1: Devuelve la fecha actual con el siguiente formato “yyyy-MM-dd”
- ValorProcesado = CDate(ValorOrigen).ToShortTimeString
- FechaLarga: Devuelve la fecha actual con el siguiente formato 03/12/2022 11:30:33
EJEMPLO:
Valor origen: “03/12/2022”
Factor: “FechaFormato”
Valor Procesado: “03-12-2022”
CONFIGURACIÓN:
Valor | Valor2 | Relacion | Relacion2 | Operacion | Factor |
FechaActual | FechaLarga | ||||
CÓDIGO:
Select Case Factor
Case “Año”
ValorProcesado = CDate(Now).Year
Case “FechaCorta”
ValorProcesado = CDate(Now).ToShortDateString
Case “FechaHora”
ValorProcesado = CDate(Now)
Case “Hora”
Dim currentTime As Date
currentTime = TimeOfDay
ValorProcesado = currentTime
Case “FechaFormato”
ValorProcesado = Format(Now, “yyyy-MM-dd HH:mm:ss”)
Case “FechaCorta1”
ValorProcesado = Format(Now, “yyyy-MM-dd”)
Case “FechaLarga”
ValorProcesado = Convert.ToDateTime(Now).ToString
End Select