Codice PHP:
<?php
class Local_date {
var $week_day;
var $day;
var $month;
var $year;
function local_date() {
$this->week_day = date("l");
$this->day = date("j");
$this->month = date("n");
$this->year = date("Y");
}
function get_day() {
$it_day = array("Monday" => "Lunedì", "Tuesday" => "Martedì", "Wednesday" => "Mercoledì", "Thursday" => "Giovedì", "Friday" => "Venerdì", "Saturday" => "Sabato", "Sunday" => "Domenica");
return $it_day[$this->week_day];
}
function get_month() {
$it_month = array("1" => "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre");
return $it_month[$this->month];
}
function build_date() {
$long_date = $this->day." ".$this->get_month()." ".$this->year;
return $long_date;
}
}
$date = new Local_date();
echo $date->build_date();
?>
Guarda se riesci ad adattare questa
semplice classe ai tuoi scopi 