Visualizzazione dei risultati da 1 a 6 su 6

Discussione: Data in php

Visualizzazione discussione

  1. #5
    Utente di HTML.it
    Registrato dal
    Jun 2015
    Messaggi
    13
    Ecco il codice che ho composto, visto che lei ha fatto il tirchio a non darmelo, era uno script semplicissimo da comporre, inoltre voglio dirle che questi tipi di codici si trovano in giro su Internet facilmente, non come lei reputa 'introvabili'. Cordiali Saluti.

    Codice PHP:
    function getCreationDateTimeSince($timestamp){
        
    $totaldelay time() - strtotime($timestamp);    {
            if(
    $years=floor($totaldelay/31536000))        { 
               
    $totaldelay $totaldelay 31536000;
                
    $getYear '';           
     if (
    $years 1)        
         
    $getYear=' anni fa';           
     else{           
     
    $getYear=' anno fa';           
     }            
    $timesince $timesince.$years.$getYear;          
      return 
    $timesince;        }             
       if(
    $months=floor($totaldelay/2628000))    
        {           
     
    $totaldelay $totaldelay 2628000;         
       
    $getMonth '';            if ($months 1)     
            
    $getMonth=' mesi fa';     
           else{          
      
    $getMonth=' mese fa';       
         }            
    $timesince $timesince.$months.$getMonth;   
             return 
    $timesince;      
      }              
      if(
    $days=floor($totaldelay/86400))      
      {       
         
    $totaldelay $totaldelay 86400;       
         
    $getDay '';      
          if (
    $days 1)       
          
    $getDay=' giorni fa';      
          else{      
          
    $getDay=' giorno fa';        
        }      
          
    $timesince $timesince.$days.$getDay;            return $timesince;        }               
     if(
    $hours=floor($totaldelay/3600))        {            $totaldelay $totaldelay 3600;            $getHour '';            if ($hours 1)             $getHour=' ore fa';            else{            $getHour=' ora fa';            }            $timesince $timesince.$hours.$getHour;            return $timesince;        }                if($minutes=floor($totaldelay/60))        {            $totaldelay $totaldelay 60;            $getMinute '';            if ($minutes 1)             $getMinute=' minuti fa';            else{            $getMinute=' minuto fa';            }            $timesince $timesince.$minutes.$getMinute;            return $timesince;        }                if($seconds=floor($totaldelay/1))        {            $totaldelay $totaldelay 1;            $getSecond '';            if ($seconds 1)             $getSecond=' secondi fa';            else{            $getSecond=' secondo fa';            }             $timesince $timesince.$seconds.$getSecond;            return $timesince;        }    }} 
    Ultima modifica di Kitt3000; 20-06-2017 a 13:08

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.