Welcome Guest, Not a member yet? Register   Sign In
change date format
#1

[eluser]persian empire[/eluser]
Hi. Friends
i have an application that is wrote by Codeigniter . i want to change all dates in this script with persian calendar (known as "hijri calendar") . I found the multi calendar from http://codeigniter.com/wiki/Calendar/
but i don't know ho to use it . please help me .
Best Regards
#2

[eluser]persian empire[/eluser]
I want when i use date(); function it shows persian calendar not default gregorian .
please if anyone know this answer me .
thank you
#3

[eluser]danmontgomery[/eluser]
I don't know what the difference between the persian and gregorian calendars are, but you should be able to use setlocale() for date and time formatting.
#4

[eluser]persian empire[/eluser]
thank you for reply but setlocal does not helped me . i want to use this code : please say me how . in the wiki page of multi calendar there is not good sample .
multi calendar file is attached .
please say me where i should copy them and how use it in my code .
#5

[eluser]persian empire[/eluser]
i have this function too . it is in zip file .
#6

[eluser]persian empire[/eluser]
No Idea ? anyone can't help me ?
#7

[eluser]danmontgomery[/eluser]
There's a sample controller in multi_calendar.zip:

Code:
class Blog extends Controller {

       function Blog()
       {
            parent::Controller();
       }
      
       function test() {
         $config=array("base_calendar"=>"persian");
        
         $this->load->library('Calendar',$config);
         echo $this->calendar->generate();
       }
}

For some reason it was written to replace the core calendar library rather than extend it, so you would have to put these in ./system/libraries
#8

[eluser]persian empire[/eluser]
I'm newbie to php .
please give me a complete sample to use this controller in my code.
i want to date() return the persian date not gregorian .
i have this code :
Code:
<?=date('H:m', strtotime($news->news_created))?>
i want to convert in to persian date
#9

[eluser]danmontgomery[/eluser]
[quote author="persian empire" date="1268426297"]I'm newbie to php .
please give me a complete sample to use this controller in my code.
i want to date() return the persian date not gregorian .[/quote]

Doesn't work that way, sorry.
#10

[eluser]persian empire[/eluser]
[quote author="noctrum" date="1268426450"][quote author="persian empire" date="1268426297"]I'm newbie to php .
please give me a complete sample to use this controller in my code.
i want to date() return the persian date not gregorian .[/quote]

Doesn't work that way, sorry.[/quote]
i know this not possible but i can replace date function /




Theme © iAndrew 2016 - Forum software by © MyBB