<?php
    require_once RUTA_APP . 'Conexion.php';
    class Util{
        public static function getDBDateAndTime():string{
            $ret = null;
            $con = getConnection();
            $query = "SELECT NOW() AS FECHA";
            if($result = sv_mysqli_query($con,$query)){
                if($row = sv_mysqli_fetch_array($result)){
                    $ret = $row["FECHA"];
                }
            }
            sv_mysqli_close($con);
            return $ret;
        }
        public static function getDBDate():string{
            $ret = null;
            $con = getConnection();
            $query = "SELECT CURDATE() AS FECHA";
            if($result = sv_mysqli_query($con,$query)){
                if($row = sv_mysqli_fetch_array($result)){
                    $ret = $row["FECHA"];
                }
            }
            sv_mysqli_close($con);
            return $ret;
        }
        public static function getDBTime():string{
            $ret = null;
            $con = getConnection();
            $query = "SELECT CURTIME() AS FECHA";
            if($result = sv_mysqli_query($con,$query)){
                if($row = sv_mysqli_fetch_array($result)){
                    $ret = $row["FECHA"];
                }
            }
            sv_mysqli_close($con);
            return $ret;
        }
    }
?>