function timeformat($logTime, $show_today = true) . . . if (setlocale(LC_TIME, @$txt['lang_locale'])) { $str = str_replace('%a', ucwords(strftime('%a', $time)), $str); $str = str_replace('%A', ucwords(strftime('%A', $time)), $str); $str = str_replace('%b', ucwords(strftime('%b', $time)), $str); $str = str_replace('%B', ucwords(strftime('%B', $time)), $str); // Convert Common Era (C.E.) into Buddhist Era (B.E., aka Thai year) $str = str_replace('%y', (strftime('%y', $time)+543)%100, $str); $str = str_replace('%Y', strftime('%Y', $time)+543, $str); } else { // Convert Common Era (C.E.) into Buddhist Era (B.E., aka Thai year) โค๊ดที่เพิ่มโดย mod Thai Year คือ 3 บรรทัดข้างล่างนี้ครับ $time_array = getdate( $time ); $str = str_replace('%y', ( $time_array['year'] + 543 ) % 100, $str); $str = str_replace('%Y', $time_array['year'] + 543, $str);
// Do-it-yourself time localization. Fun. $str = str_replace('%a', @$txt['days_short'][(int) strftime('%w', $time)], $str); $str = str_replace('%A', @$txt['days'][(int) strftime('%w', $time)], $str); $str = str_replace('%b', @$txt['months_short'][(int) strftime('%m', $time)], $str); $str = str_replace('%B', @$txt['months'][(int) strftime('%m', $time)], $str); $str = str_replace('%p', (strftime('%H', $time) < 12 ? 'am' : 'pm'), $str); }
// Format any other characters.. return strftime($str, $time); }
|