<?
	function u_dan($date_time = 0, $brojcano = 0, $lang = 0){
		if($date_time == 0){
			$date_time = "now";
		}
  	$l_timestamp = strtotime($date_time);
  	if($brojcano){
    	$izl =  date("w", $l_timestamp);
      return $izl;
    }
		switch(date("w", $l_timestamp)){
    	case 0:
      	$izl = "Nedjelja";
				if($lang == 1){
					$izl = "Sunday";
				}
				if($lang == 2){
					$izl = "Nedelja";
				}
        break;
    	case 1:
      	$izl = "Ponedjeljak";
				if($lang == 1){
					$izl = "Monday";
				}
				if($lang == 2){
					$izl = "Ponedeljak";
				}
        break;
    	case 2:
      	$izl = "Utorak";
				if($lang == 1){
					$izl = "Tuesday";
				}
				if($lang == 2){
					$izl = "Utorak";
				}
        break;
    	case 3:
      	$izl = "Srijeda";
				if($lang == 1){
					$izl = "Wednesday";
				}
				if($lang == 2){
					$izl = "Sreda";
				}
        break;
    	case 4:
      	$izl = "Četvrtak";
				if($lang == 1){
					$izl = "Thursday";
				}
				if($lang == 2){
					$izl = "Četvrtak";
				}
        break;
    	case 5:
      	$izl = "Petak";
				if($lang == 1){
					$izl = "Friday";
				}
				if($lang == 2){
					$izl = "Petak";
				}
        break;
    	case 6:
      	$izl = "Subota";
				if($lang == 1){
					$izl = "Saturday";
				}
				if($lang == 2){
					$izl = "Subota";
				}
        break;
    }
    return $izl;
  }

	function u_datum($date_time = 0, $pocetna_nula = 0){
		if($date_time == 0){
			$date_time = "now";
		}
  	$l_timestamp = strtotime($date_time);
    if($pocetna_nula){
			$izl = date("d", $l_timestamp);
    }else{
			$izl = date("j", $l_timestamp);
    }
    return $izl;
  }

	function u_mjesec($date_time = 0, $brojcano = 0, $lang = 0){
		if($date_time == 0){
			$date_time = "now";
		}
  	$l_timestamp = strtotime($date_time);
  	if($brojcano){
    	$izl = date("m", $l_timestamp);
      return $izl;
    }
		global $pis;
		if($pis == "cir"){
			switch(date("n", $l_timestamp)){
				case 1:
					$izl = "januara";
					break;
				case 2:
					$izl = "februara";
					break;
				case 3:
					$izl = "marta";
					break;
				case 4:
					$izl = "aprila";
					break;
				case 5:
					$izl = "maja";
					break;
				case 6:
					$izl = "juna";
					break;
				case 7:
					$izl = "jula";
					break;
				case 8:
					$izl = "augusta";
					break;
				case 9:
					$izl = "septembra";
					break;
				case 10:
					$izl = "oktobra";
					break;
				case 11:
					$izl = "novembra";
						break;
				case 12:
					$izl = "decembra";
					break;
			}
		}else{
			switch(date("n", $l_timestamp)){
				case 1:
					$izl = "siječnja";
					if($lang){
						$izl = "January";
					}
					break;
				case 2:
					$izl = "veljače";
					if($lang){
						$izl = "February";
					}
					break;
				case 3:
					$izl = "ožujka";
					if($lang){
						$izl = "March";
					}
					break;
				case 4:
					$izl = "travnja";
					if($lang){
						$izl = "April";
					}
					break;
				case 5:
					$izl = "svibnja";
					if($lang){
						$izl = "May";
					}
					break;
				case 6:
					$izl = "lipnja";
					if($lang){
						$izl = "June";
					}
					break;
				case 7:
					$izl = "srpnja";
					if($lang){
						$izl = "July";
					}
					break;
				case 8:
					$izl = "kolovoza";
					if($lang){
						$izl = "August";
					}
					break;
				case 9:
					$izl = "rujna";
					if($lang){
						$izl = "September";
					}
					break;
				case 10:
					$izl = "listopada";
					if($lang){
						$izl = "October";
					}
					break;
				case 11:
					$izl = "studenog";
					if($lang){
						$izl = "November";
					}
					break;
				case 12:
					$izl = "prosinca";
					if($lang){
						$izl = "December";
					}
					break;
			}
		}
    return $izl;
  }

	function u_godina($date_time = 0, $skraceno = 0){
		if($date_time == 0){
			$date_time = "now";
		}
  	$l_timestamp = strtotime($date_time);
		if($skraceno){
			return date('y', $l_timestamp);
		}else{
			return date('Y', $l_timestamp);
		}
  }

	function u_godina_current($date_time = 0, $skraceno = 0){
		return u_godina($date_time);/*REPLACE YEAR INTO OLD YEAR*/
  }

	function u_sat($date_time = "now"){
  	$l_timestamp = strtotime($date_time);
		return date('H', $l_timestamp);
  }

	function u_minuta($date_time = "now"){
  	$l_timestamp = strtotime($date_time);
		return date('i', $l_timestamp);
  }

	function u_sekunda($date_time = "now"){
  	$l_timestamp = strtotime($date_time);
		return date('s', $l_timestamp);
  }

?>