3 // ============================================================
6 // return a formated string for date
7 // @args: string (date string), boolean (include day of week)
8 // (it uses $_SESSION['language_choice'] )
9 // @return: $date_string (string) - formated string
10 // Cristian Navalici lemonsoftware at gmail dot com
12 // For Hebrew must be implemented a special calendar functions
14 // 10.07.2007 - dateformat accepts now an argument
15 // ============================================================
17 function dateformat($strtime = '', $with_dow = false)
20 // without an argument, display current date
22 $strtime = strtotime('now');
25 // string date is formed by
26 // $dow + date(day) + $nom + date(year) or similar
28 // name the day of the week for different languages
29 $day = date("w", $strtime); // 0 sunday -> 6 saturday
42 $dow = xl('Wednesday');
45 $dow = xl('Thursday');
51 $dow = xl('Saturday');
55 // name of the month in different languages
56 $month = (int) date('m', $strtime);
63 $nom = xl('February');
84 $nom = xl('September');
90 $nom = xl('November');
93 $nom = xl('December');
98 // First, get current language title
99 $languageTitle = getLanguageTitle($_SESSION['language_choice']);
100 switch ($languageTitle) {
101 // standard english first
102 case getLanguageTitle(1):
103 $dt = date("F j, Y", $strtime);
109 $dt = date("Y", $strtime) . " $nom " . date("d", $strtime);
115 case "Spanish (Spain)":
116 case "Spanish (Latin American)":
117 $dt = date("d", $strtime) . " $nom " . date("Y", $strtime);
123 $dt = date("d", $strtime) . " $nom " . date("Y", $strtime);
129 $dt = date("d", $strtime) . " $nom " . date("Y", $strtime);
134 // hebrew (israel) , display english NOT jewish calendar
136 $dt = date("d", $strtime) . " $nom " . date("Y", $strtime);
143 $dt = "$nom " . date("d", $strtime) . ", " . date("Y", $strtime);