MLT

[gentoo.org source code] accesso_sql.php

MLT
Apr 17th, 2014
317
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.98 KB | None | 0 0
  1. <?
  2.  
  3. function CorrigeZeros($data)
  4. {
  5.   foreach ($data as $cod => $temp)
  6.     if (strlen($data[$cod])<2)
  7.       $data[$cod]="0".$data[$cod];
  8.   return ($data);
  9. }
  10.  
  11. function Data2UnixTime($data)
  12. {
  13.  
  14.   $data=explode("/",$data);
  15.   return(mktime(0,0,0,$data[1],$data[0],$data[2]));
  16. }
  17.  
  18. function UnixTime2Ano($timestamp)
  19. {
  20.   $temp=getdate($timestamp);
  21.   return $temp['year'];
  22. }
  23.  
  24. function UnixTime2DataHora($timestamp,$formato="N")  // Numerico, Abreviado, Extenso
  25. {
  26.   if ($timestamp=="" || $timestamp==0 || $timestamp==-1)
  27.     return "";
  28.   $temp=getdate($timestamp);
  29.   $temp=CorrigeZeros($tem0);
  30.   $temp['mon']=($formato=="N" ? $temp['mon'] : ( $formato=="E" ? NomeMes($temp['mon']) : NomeMesAbreviado($temp['mon'])));
  31.   $data=$temp['mday']."/".$temp['mon']."/".$temp['year']." ".$temp['hours'].":".$temp['minutes'].":".$temp['seconds'];
  32.   return ($data);
  33. }
  34.  
  35. function UnixTime2Data($timestamp,$formato="N")  // Numerico, Abreviado, Extenso
  36. {
  37.   if ($timestamp=="" || $timestamp==0 || $timestamp==-1)
  38.     return "";
  39.   $temp=getdate($timestamp);
  40.   $temp=CorrigeZeros($temp);
  41.   $temp['mon']=($formato=="N" ? $temp['mon'] : ( $formato=="E" ? NomeMes($temp['mon']) : NomeMesAbreviado($temp['mon'])));
  42.   $data=$temp['mday']."/".$temp['mon']."/".$temp['year'];
  43.   return ($data);
  44. }
  45.  
  46. function UnixTime2Hora($timestamp,$formato="N")  
  47. {
  48.   if ($timestamp=="" || $timestamp==0 || $timestamp==-1)
  49.     return "";
  50.   $temp=getdate($timestamp);
  51.   $temp=CorrigeZeros($temp);
  52.   $data=$temp['hours'].":".$temp['minutes'].":".$temp['seconds'];
  53.   return ($data);
  54. }
  55.  
  56. function NomeMes($nummes)
  57. {
  58.   $meses=explode(",","Mês inválido,Janeiro,Fevereiro,Março,Abril,Maio,Junho,Julho,Agosto,Setembro,Outubro,Novembro,Dezembro");
  59.   return $meses[(int)$nummes];
  60. }
  61.  
  62. function NomeMesAbreviado($nummes)
  63. {
  64.   /* 7 - Mês inválido,Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez */
  65.   $meses=explode(",","Inv,Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez");
  66.   return $meses[(int)$nummes];
  67. }
  68.  
  69. ?>
Advertisement
Comments
  • Cuiznxcn
    163 days
    # text 0.19 KB | 0 0
    1. Best t33n active cpx link daily updates!
    2.  
    3. Copy and paste the link in a new browser tab and then hit enter!
    4.  
    5. https://crazyporn.xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
    6.  
Add Comment
Please, Sign In to add comment