Jump to content

Day and month change to local language.


mmarif4u

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.