Ver Mensaje Individual
  #5 (permalink)  
Antiguo 27/04/2007, 11:18
Avatar de AlZuwaga
AlZuwaga
Colaborador
 
Fecha de Ingreso: febrero-2001
Ubicación: 34.517 S, 58.500 O
Mensajes: 14.550
Antigüedad: 24 años, 1 mes
Puntos: 535
Re: Reconvertir tiempo unix epoch a fecha copmun en asp

Hola, según la wikipedia, tenemos esto:

Cita:
The Unix time number is zero at the Unix epoch, and increases by exactly 86 400 per day since the epoch. Thus 2004-09-16T00:00:00Z, 12 677 days after the epoch, is represented by the Unix time number 12 677 × 86 400 = 1 095 292 800.
http://en.wikipedia.org/wiki/Unix_time
Entonces (si no te interesa saber las horas y minutos) te propongo lo siguiente:

Código:
<%
epoch = 1095292800
segundos = 60
minutos = 60
horas = 24
segundos_por_dia = segundos * minutos * horas

dias = epoch / segundos_por_dia

fecha = DateAdd("D", dias, "1970-01-01")

response.write fecha
%>
Te dejo como ejercicio obtener las horas y minutos ;)
Saludos

Edit: Se me antici´po el master tigurón ñ_Ñ
__________________
...___...