source: admin/WebConsole/includes/InvFecha.php @ 43763e4

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacion
Last change on this file since 43763e4 was b6ec162, checked in by Ramón M. Gómez <ramongomez@…>, 6 years ago

#834: Remove all redundant PHP closing tags.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1<?php
2/*______________________________________________________________________
3        Cambia de posicion los extremos de una fecha. Devuelve una fecha con formato
4        dd-mm-aaaa si el formato de entrada es aaaa-mm-dd y viseversa
5        Parametros:
6                - fecha: Una cadena con los datos de una fecha
7_______________________________________________________________________*/
8function InvFecha($fecha){
9        if ($fecha=="1970-01-01")return("");
10
11        $auxexplode=explode(" ",$fecha);
12        list($anno_p,$mes_p,$dia_p)=explode("[/-]",$auxexplode[0]);
13        $fecha_p=$dia_p.'-'.$mes_p.'-'.$anno_p;
14        return($fecha_p);
15}
16////////////////////////////////////////////////////
17//Convierte fecha de mysql a normal
18////////////////////////////////////////////////////
19function sacafechaDB($fecha){
20    preg_match("~([0-9]{2,4})-([0-9]{1,2})-([0-9]{1,2})~", $fecha, $mifecha);
21    $lafecha=$mifecha[3]."/".$mifecha[2]."/".$mifecha[1];
22    return $lafecha;
23}
24
25////////////////////////////////////////////////////
26//Convierte fecha de normal a mysql
27////////////////////////////////////////////////////
28
29function metefechaDB($fecha){
30    preg_match("~([0-9]{1,2})/([0-9]{1,2})/([0-9]{2,4})~", $fecha, $mifecha);
31    $lafecha=$mifecha[3]."-".$mifecha[2]."-".$mifecha[1];
32    return $lafecha;
33}
34function HoraValida($hora){
35        if ($hora=="00:00:00")return("");
36}
37
Note: See TracBrowser for help on using the repository browser.