function hours12ToTimestamp24( $hora ){
#Saco solo hora y min en un array
$horaArray = explode(":", $hora);
if( sizeof( $horaArray ) < 2 ) return 0;
#Si tiene pm en el string le sumo 12 hs al mod de la hora sobre 12.
$extra = strstr(strtolower($hora), 'pm') || strstr(strtolower($hora), 'p.m')? 12 : 0;
return mktime(($horaArray[0]%12)+$extra, $horaArray[1], 0, 1, 1, 1970 );
}
Leave a Reply
You must be logged in to post a comment.