Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/11/2005, 15:29
antonio2005pe
 
Fecha de Ingreso: agosto-2005
Ubicación: Peru-Lima
Mensajes: 225
Antigüedad: 18 años, 9 meses
Puntos: 0
problema al cambiar la hora del sistema(FAQ)

Cita:
Iniciado por David el Grande
Código:
 
Private Declare Function SetSystemTime Lib "kernel32.dll" (lpSystemTime As SYSTEMTIME) As Long
Public Type SYSTEMTIME 
wYear As Integer
		 wMonth As Integer
		 wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Public Function CambiarHora(ByVal Hora As Integer, ByVal Minutos As Integer, Byval Segundos As Integer)
Dim Ahora As SYSTEMTIME 
Ahora.wYear = Year(Date)
Ahora.wMonth = Month(Date)
Ahora.wDay = Day(Date)
Ahora.wHour = Hora
Ahora.wMinute = Minutos
Ahora.wSecond = Segundos
CambiarHora = SetSystemTime(Ahora)
End Function
Public Function CambiarFecha(Byval Año As Integer, Byval Mes As Integer, Byval Dia As Integer)
Dim Hoy As SYSTEMTIME 
Hoy.wYear = Año
Hoy.wMonth = Mes
Hoy.wDay = Dia
Hoy.wHour = Hour(Time)
Hoy.wMinute = Minute(Time)
Hoy.wSecond = Second(Time)
CambiarFecha = SetSystemTime(Hoy)
End Function
Hola encontre esto en las FAQ pero no se que pasa la hora no cambia solo cambia los minutos y segundos :S puse el siguiente codigo para llamar:
x=CambiarHora(5,31,10)
y no se k es lo k pasa :(