Version: 1.0
Type: Function
Category: Calendars/Dates
License: WebSite Only
Description: this is a customizable function base on date() that return a string:
Name of the day – date (number) – name of the month – year (4 digits).
Just change name of the day and name of the month to your language!
(I’m a beginner!)
<? /* This is my first script in PHP! Version 1.0 This function return a string containing date formatted for italian language: You can see: Name of the day - date (number) - name of the month - year (4 digits) An example: Gioved 22 Novembre 2001 (Tuesday 22 November 2001) Hope its clear, my English it's not very good! This script is free, enjoy it! [email protected] */ function giorno() { $giorno = date("l"); switch($giorno) { case "Sunday": $giorno = "Domenica "; //change in your language break; case "Monday": $giorno = "Luned "; //change in your language break; case "Tuesday": $giorno = "Marted "; //change in your language break; case "Wednesday": $giorno = "Mercoled "; //change in your language break; case "Thursday": $giorno = "Gioved "; //change in your language break; case "Friday": $giorno = "Venerd "; //change in your language break; case "Saturday": $giorno = "Sabato "; //change in your language } $mese = date("n"); switch($mese) { case "1": $mese = " Gennaio "; //change in your language break; case "2": $mese = " Febbraio "; //change in your language break; case "3": $mese = " Marzo "; //change in your language break; case "4": $mese = " Aprile "; //change in your language break; case "5": $mese = " Maggio "; //change in your language break; case "6": $mese = " Giugno "; //change in your language break; case "7": $mese = " Luglio "; //change in your language break; case "8": $mese = " Agosto "; //change in your language break; case "9": $mese = " Settembre "; //change in your language break; case "10": $mese = " Ottobre "; //change in your language break; case "11": $mese = " Novembre "; //change in your language break; case "12": $mese = " Dicembre "; //change in your language } // Change the order to get the exact string you want $oggi = $giorno; //name of the day $oggi .= date("d"); //date (number) $oggi .= $mese; //name of the month $oggi .= date("Y"); //year (4 digit) return $oggi; } ?>