Jump to content
Forumu Destekleyenlere Katılın ×
Paticik Forumları
2000 lerden beri faal olan, çok şukela bir paylaşım platformuyuz. Hoşgeldiniz.

PHP Tarihi İngilizce Göstermesi


Öne çıkan mesajlar

Mesaj tarihi:
Sitede haberler olsun vs. olsun yanına ayla beraber günün tarihini koyuyo ama ingilizce . Birine sordum burayı customize et dedi gitti.Customize edilmiyo ki , sadece ordan tipini değiştirebiliyorum. Nasıl Türkçe yaparız bunu ? Örnek olarak 3 harf APR ( April ) yazıyo 05 koyuyo . : ?

https://jsfiddle.net/wc6sjeqy/
Mesaj tarihi:
Example #4 date() Formatting

// Assuming today is March 10th, 2001, 5:16:18 pm, and that we are in the
// Mountain Standard Time (MST) Time Zone

$today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm
$today = date("m.d.y"); // 03.10.01
$today = date("j, n, Y"); // 10, 3, 2001
$today = date("Ymd"); // 20010310
$today = date('h-i-s, j-m-y, it is w Day'); // 05-16-18, 10-03-01, 1631 1618 6 Satpm01
$today = date('it is the jS day.'); // it is the 10th day.
$today = date("D M j G:i:s T Y"); // Sat Mar 10 17:16:18 MST 2001
$today = date('H:m:s m is month'); // 17:03:18 m is month
$today = date("H:i:s"); // 17:16:18
$today = date("Y-m-d H:i:s"); // 2001-03-10 17:16:18 (the MySQL DATETIME format)
?>
To format dates in other languages, you should use the setlocale() and strftime() functions instead of date().
Mesaj tarihi:
/* Yereli Türkçe yapalım */
setlocale(LC_ALL, 'tr_TR.UTF-8');

/* Çıktısı: 22 Aralık 1978 Cuma */
echo strftime("%e %B %Y %An", mktime(0, 0, 0, 12, 22, 1978));

/* Türkçe için farklı yerel isimleri deneyelim (PHP 4.3.0 ve sonrası) */
$loc_tr = setlocale(LC_ALL, 'tr_TR.UTF-8', 'tr_TR', 'tr', 'turkish');
echo "Türkçe için tercih edilen yerel ismi: '$loc_trn'";
?>
Mesaj tarihi:

add_filter( 'wp_insert_post_data', 'set_new_schedule_title', '11', 2 );
function set_new_schedule_title( $data , $postarr ) {
if (array_key_exists('acf',$postarr)) {
$fields = $postarr['acf'];
if($data['post_type'] == 'sports_team_schedule' && array_key_exists('field_517469f847138',$fields)) {
$schedule_date = $fields['field_517469f847138'];
$schedule_time = $fields['field_51746a5647139'];
$sports_team_schedule_type = $postarr['tax_input']['sports_team_schedule_type'][1];
$schedule_date_stamp = strtotime($schedule_date);
setlocale(LC_ALL, 'tr_TR.UTF-8');
$schedule_date_formatted = strftime("%V,%G,%Y", $schedule_date_stamp); //YOU CAN CUSTOMIZE THE DATE FORMAT HERE http://php.net/manual/en/function.date.php
$atword = __('when', 'wp-sports-team'); // YOU CAN CHANGE THIS HERE
$display_the_time = get_option('sports_team_schedule_type_' . $sports_team_schedule_type . '_display_time', null);
if (!isset($display_the_time)) { $display_the_time = "1"; }
if ($display_the_time == "1") {
$schedule_title = $schedule_date_formatted . ' ' . $atword . ' ' . $schedule_time; //YOU COULD CHANGE ORDER HERE
} else {
$schedule_title = $schedule_date_formatted;
}
$post_slug = sanitize_title_with_dashes ($schedule_title,'','save');
$post_slugsan = sanitize_title($post_slug);

$data['post_title'] = $schedule_title;
$data['post_name'] = $post_slugsan;
}
}
return $data;
}
×
×
  • Yeni Oluştur...