403Webshell
Server IP : 103.48.194.25  /  Your IP : 216.73.217.33
Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33
System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64
User : sieuthimay ( 1016)
PHP Version : 8.2.20
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/zomuaban.com/public_html/webadmin/helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/zomuaban.com/public_html/webadmin/helpers/MY_date_helper.php
<?php
function difftime($nb_second=0)
{
	
}
function str_diff_time($date1, $date2=0)
{
	if(empty($date2)) $date2 = date('Y-m-d H:i:s') ;
	$datetime1 = new DateTime($date1);
	$datetime2 = new DateTime($date2);
	$t = $datetime1->diff($datetime2);
	
	if($t->invert==0)
	{
		switch($t->days)
		{
			case 0 :
				if($t->h==0)
					if($t->i==0)
						return 'Cách đây '.$t->s.' giây' ;
					else
						return 'Cách đây '.$t->i.' phút' ;
				else
					return 'Cách đây '.$t->h.' giờ '.$t->i.' phút' ;
				break ;
			case 1	:
				return 'Cách đây '.$t->days.' ngày '.$t->h.' giờ ' ;
				break;
			case 2	:
				return 'Cách đây '.$t->days.' ngày' ;
				break;
			default :
				return date('H:i d/m/Y', strtotime($date1)) ;
				break ;
		}
	}
}
function date_mysql2vn($strdata='', $op=0)
{
	if(empty($strdata)) return '';
	$strdata = $op? date("d/m/Y", strtotime($strdata)) : date("d/m/Y H:i:s", strtotime($strdata)) ;
	return $strdata;
} 

function datemysql($day=''){
	return strftime("%Y-%m-%d", strtotime($day));
} 
function datevn2mysql($day=''){
	$data = explode("/", $day) ;
	return $data[2]."-".$data[1]."-".$data[0];
}
function dateus2mysql($day=''){
	$data = explode("/", $day) ;
	return $data[2]."-".$data[0]."-".$data[1];
}
function datevn($day='', $dot='.'){
	if(empty($day)) return '';
	return strftime("%d$dot%m$dot%Y", strtotime($day));
} 
function disdate($d1,$d2){
    //date yyyy-mm-dd
    $ar = explode("-",$d1) ;
    $br = explode("-",$d2) ;
   
    $a = mktime(0,0,0,intval($ar[1]),intval($ar[2]),intval($ar[0])) ;
    $b = mktime(0,0,0,intval($br[1]),intval($br[2]),intval($br[0])) ;
   
    $c = $b - $a ;
    $e = $c / (24 * 60 * 60) ;
   
    return $e ;
}

function countdate($date, $str)
{
	$date = new DateTime($date);
	$date->modify($str);
	return $date->format('Y-m-d');

}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit