Ver Mensaje Individual
  #8 (permalink)  
Antiguo 10/06/2012, 12:45
Requenaeo
 
Fecha de Ingreso: marzo-2011
Ubicación: Punta de Mata
Mensajes: 106
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: Sistema de horarios

Código PHP:
Ver original
  1. <?php
  2.     $fecha = date('h:i a',time() - 3600*date('I'));
  3.    $hora = date('h:i a',time() - 3600*date('I'));
  4.      
  5.     $horaIni = $fecha.'01:00 pm'; //1 de la  tarde
  6.     $unixIni = strtotime($hora);
  7.      
  8.     $horaFin = $fecha.'03:00 pm'; // hasta 2 de la tarde
  9.     $unixFin = strtotime($horaFin);
  10.      
  11.     $actual = date('h:i a',time() - 3600*date('I'));
  12.     $unixActual = strtotime($actual);
  13.      
  14.     if ($unixActual >= $horaIni && $unixActual <= $horaFin) {
  15.         echo 'Despertar!.';
  16.     }else {
  17.         echo 'fuera del rango';
  18.     }
  19. ?>

Lo que dice es fuera de rango.!