Locale time format help please

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Locale time format help please
yanger
CZ Super Newbie
yanger has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Apr 27, 2006
0.00 posts per day
Posts: 33
Points: 918
   
Hello again everyone...

I have yet another problem on my site that i wants fixed very badly,

I am from india and i don't know how to fix the local time format. In my Perferences page the locale time format is en_US, since USA is a date behind India the date on my site shows a date late, i want to change it to Indian date,, what format should i use??? will it be something like this??? en_IN or.... please help...



Back to top Reply with quote
#2   
Gareth
CZ Addict
 Codezwiz Site Donator
Gareth has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Student, Webmaster
Gender: Male
Fav. Sports Team: Liverpool FC
Status: Offline
Joined: May 29, 2004
0.08 posts per day
Posts: 587
Points: 38,220
   
I think you change the site timezone in the forum settings.


I'm not 100% sure but I think it is icon_cool.gif

Gareth




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#3   
yanger
CZ Super Newbie
yanger has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Apr 27, 2006
0.00 posts per day
Posts: 33
Points: 918
   
i have changed it but it's still not working...

Okay today is the 31st of may 2006 here in India... just now i have posted a news on my site and this is the date it shows on my news page.

Posted by admin on Tuesday, May 30 @ 22:56:24 PDT

I want it to show May 31 but don't know how... i have this settings on my forum time as instructed above...

System timezone is set to GMT+5.30



Back to top Reply with quote
#4   re: Locale time format help please
Gareth
CZ Addict
 Codezwiz Site Donator
Gareth has been a member for over 20 year's 20 Year Member
uk.gif
Occupation: Student, Webmaster
Gender: Male
Fav. Sports Team: Liverpool FC
Status: Offline
Joined: May 29, 2004
0.08 posts per day
Posts: 587
Points: 38,220
   
Ah, i've found out the Nuke time is set in mainfile.php

The hours to add or subtract will depend on your local server time.

Find this in your mainfile.php (if you can't find it just search for the bit up to mktime( and you should find it)
   $datetime = strftime(""._DATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]));

And replace it with:
   $datetime = strftime(""._DATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],datetime[2],$datetime[3],$datetime[1]) + 3600);


Where it says + 3600, you should change that depending on what your server time is. So if your server time was e.g. 10am. Adding 3600 would make it 11am.
3600 = an hour. Obviously half an hour is half that ect..

Any more problems feel free to ask icon_mrgreen.gif

Gareth


Back to top Reply with quote
#5   
yanger
CZ Super Newbie
yanger has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Apr 27, 2006
0.00 posts per day
Posts: 33
Points: 918
   
wow Gareth... thank you so much for taking your time solving my problem... Thank you very much.

I'll try to change it now. If i come upon any problem please help me again. I'll let you know about how it worked out after i changed it.



Back to top Reply with quote
#6   
yanger
CZ Super Newbie
yanger has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Apr 27, 2006
0.00 posts per day
Posts: 33
Points: 918
   
I tried replacing this line to my mainfile.php

$datetime = strftime(""._DATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]));

with

$datetime = strftime(""._DATESTRING."", mktime($datetime[4],$datetime[5],$datetime[6],datetime[2],$datetime[3],$datetime[1]) + 41400);

and i got this error.

Parse error: parse error, unexpected '[' in /home/naga/public_html/mainfile.php on line 805

Help Gareth.



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum