Funciones de Tiempo y Hora
En Visual Basic .NET existen funciones a través de las cuales es posible manipular el tiempo y la hora:
TimeString, regresa la hora actual del sistema.
DateString, regresa la fecha actual del sistema.
Now, regresa un valor codificado que representa la hora y fecha actual del sistema.
Hour(hora), regresa el número de hora actual del sistema.
Minute(hora), regresa el número de minuto actual del sistema.
Second(hora), regresa el múmero del segundo actual del sistema.
Day(fecha), regresa el número del día actual del sistema.
Month(fecha), regresa el número de mes actual del sistema.
Year(fecha), regresa el año actual del sistema.
Weekday(fecha), regresa el número que representa el día de la semana. (1 = Domingo, 2 = Lunes, ...).
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)_
Handles Button1.Click
txtTimeString.Text = TimeString
End Sub
Private Sub DateString_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)_
Handles Button2.Click
txtDateString.Text = DateString
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)_
Handles Button3.Click
txtNow.Text = Now
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)_
Handles Button4.Click
txtHour.Text = Hour(Now)
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)_
Handles Button5.Click
txtMinute.Text = Minute(Now)
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)_
Handles Button6.Click
txtSecond.Text = Second(Now)
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)_
Handles Button7.Click
txtDay.Text = Microsoft.VisualBasic.DateAndTime.Day(Now)
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)_
Handles Button8.Click
txtMonth.Text = Month(Now)
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)_
Handles Button9.Click
txtYear.Text = Year(Now)
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)_
Handles Button10.Click
txtWeekday.Text = Weekday(Now)
End Sub
en sql manejo solo las del sistema la getdate()
ejemplo en analizador de consultas
select getdate()
pero es muy general devuelve demasiados parametros
Saludos cordiales OJALA AYUDE EN ALGO ESTO
JAVIER RUIZ
[email protected]
SANTIAGO DE CHILE