Last active
October 14, 2017 19:46
-
-
Save davutkmbr/5b2a8fe2f5f2d55776e0e2a6d9d73066 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dateLocale($f, $zt = 'now'){ | |
$z = date($f, strtotime($zt)); | |
$donustur = array( | |
'Monday' => 'Pazartesi', | |
'Tuesday' => 'Salı', | |
'Wednesday' => 'Çarşamba', | |
'Thursday' => 'Perşembe', | |
'Friday' => 'Cuma', | |
'Saturday' => 'Cumartesi', | |
'Sunday' => 'Pazar', | |
'January' => 'Ocak', | |
'February' => 'Şubat', | |
'March' => 'Mart', | |
'April' => 'Nisan', | |
'May' => 'Mayıs', | |
'June' => 'Haziran', | |
'July' => 'Temmuz', | |
'August' => 'Ağustos', | |
'September' => 'Eylül', | |
'October' => 'Ekim', | |
'November' => 'Kasım', | |
'December' => 'Aralık', | |
'Mon' => 'Pts', | |
'Tue' => 'Sal', | |
'Wed' => 'Çar', | |
'Thu' => 'Per', | |
'Fri' => 'Cum', | |
'Sat' => 'Cts', | |
'Sun' => 'Paz', | |
'Jan' => 'Oca', | |
'Feb' => 'Şub', | |
'Mar' => 'Mar', | |
'Apr' => 'Nis', | |
'Jun' => 'Haz', | |
'Jul' => 'Tem', | |
'Aug' => 'Ağu', | |
'Sep' => 'Eyl', | |
'Oct' => 'Eki', | |
'Nov' => 'Kas', | |
'Dec' => 'Ara', | |
); | |
foreach($donustur as $en => $tr){ | |
$z = str_replace($en, $tr, $z); | |
} | |
if ( strpos($z, 'Mayıs' ) !== false && strpos($f, 'F') === false) $z = str_replace('Mayıs', 'May', $z); | |
return $z; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment