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...
I need a fix to this very urgently someone please help. Since my site deals with Daily local news, showing the wrong date on the News Articles bugs our readers. Help...
Say you need to add 12 hours (+12)
Open your mainfile and find:
Code:
function formatTimestamp($time) {
global $datetime, $locale;
setlocale (LC_TIME, $locale);
ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime);
// We've got to use strftime to use the $locale var
$datetime = strftime(""._DATESTRING."", mktime($datetime[4]+12,$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]));
$datetime = ucfirst($datetime);
return $datetime;
}
Notice in there where it says
Code:
mktime($datetime[4]+12,
I added the +12 to adjust it or add 12 hours more.... add or subtract whatever you need.
To subtract hours just use -12 etc.
There's more info HERE
It also shows you how to change the way it looks if needed (datestring)
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