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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.