0 สมาชิก และ 4 บุคคลทั่วไป กำลังดูหัวข้อนี้
// Do-it-yourself time localization. Fun.
// Convert Common Era (C.E.) into Buddhist Era (B.E., aka Thai year) $time_array = getdate( $time ); $str = str_replace( '%y', ( $time_array['year'] + 543 ) % 100, $str ); $str = str_replace( '%Y', $time_array['year'] + 543, $str );
if (setlocale(LC_TIME, $txt['lang_locale'])) { foreach (array('%a', '%A', '%b', '%B') as $token) if (strpos($str, $token) !== false) $str = str_replace($token, $func['ucwords'](strftime($token, $time)), $str);
if (setlocale(LC_TIME, $txt['lang_locale'])) { if (!isset($non_twelve_hour)) $non_twelve_hour = trim(strftime('%p')) === ''; if ($non_twelve_hour && strpos($str, '%p') !== false) $str = str_replace('%p', (strftime('%H', $time) < 12 ? $txt['time_am'] : $txt['time_pm']), $str); foreach (array('%a', '%A', '%b', '%B') as $token) if (strpos($str, $token) !== false) $str = str_replace($token, !empty($txt['lang_capitalize_dates']) ? $smcFunc['ucwords'](strftime($token, $time)) : strftime($token, $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);
erroe อ่าครับ