Esempio n. 1
0
function getHora($fecha)
{
    //Mar. 6:30 - 10:00 pm
    if ($fecha == "") {
        return "";
    }
    $h = explode(' ', $fecha);
    $hm = $h[1];
    if (isset($h[4]) && $h[4] == "pm") {
        return sumaTiempo($hm);
    } else {
        return $hm;
    }
}
Esempio n. 2
0
<?php

date_default_timezone_set('America/Bogota');
function sumaTiempo($horas)
{
    $t = explode(":", $horas);
    return $t[0] + 12 . ":" . $t[1];
}
echo sumaTiempo('6:30');