mmarif4u Posted March 15, 2008 Share Posted March 15, 2008 Hi to all. I am trying to change my site date and time to local language. For example: sunday march 15 2008 to Isnin marc 15 2008. How can i do this without getting help from host. I mean in php,make any function some thing like that. OR any link to follow. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/96264-day-and-month-change-to-local-language/ Share on other sites More sharing options...
GingerRobot Posted March 15, 2008 Share Posted March 15, 2008 As far as i'm aware, you have no option but to write a function: <?php function localdate(){ //replace with local names $days = array('Sunday','Monday','Tuesday','Wednesday','Thusday','Friday','Saturday'); $months = array('January','February','March','April','May','June','July','August','September','October','November','December'); list($day,$month,$date,$year) = explode(' ',date('w n j Y')); $day = $days[$day]; $month = $months[$month - 1]; return $day.' '.$month.' '.$date.' '.$year; } echo localdate(); ?> Edit: Perhaps not. If your language is one that is supported, this may be of some use: http://uk3.php.net/manual/en/function.setlocale.php Link to comment https://forums.phpfreaks.com/topic/96264-day-and-month-change-to-local-language/#findComment-492782 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.