-
AuthorPosts
-
nant Friend
nant
- Join date:
- October 2007
- Posts:
- 10
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 3
- Thanked:
- 1 times in 1 posts
December 31, 2009 at 10:09 am #147195Ja_teline III
The last update date appear to always display in a format like:
08:07:17 AM GMT
Is there a way to change this to follow specific language?
gray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
January 2, 2010 at 9:16 am #327957In templatesja_teline_iiilibsja.template.helper.p hp you can find function getLastUpdate()
Line [php] return gmdate(“h:i:s A”, $sec+$tz).’ GMT’; [/php]
defines format of the output.For example, the below code results in the output
Last Update: 05 Dec 09:16 GMT
[php] return gmdate(“d M G:i”, $sec+$tz).’ GMT’; [/php]See this post for more details, including if you get month not in English (setlocale would be required)
1 user says Thank You to gray for this useful post
nant Friendnant
- Join date:
- October 2007
- Posts:
- 10
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 3
- Thanked:
- 1 times in 1 posts
January 3, 2010 at 8:46 pm #328042Thanks for your reply.
I looks at this function:
function getLastUpdate(){
$db = &JFactory::getDBO();
$query = 'SELECT created FROM #__content a ORDER BY created DESC LIMIT 1';
$db->setQuery($query);
$data = $db->loadObject();
if( $data->created ){ //return gmdate( 'h:i:s A', strtotime($data->created) ) .' GMT ';
$date =& JFactory::getDate(strtotime($data->created));
$user =& JFactory::getUser();
$tz = $user->getParam('timezone');
$sec =$date->toUNIX(); //set the date time to second
return gmdate("h:i:s A", $sec+$tz).' GMT';
}
return ;
}There appears to be something wrong with this.
The line that returns the timezone of the viewer appears to always return null (even if a user is logged in at the moment).Can you please run this with your zend debugger on and verify this.
It looks like the date will never be adjusted to GMT. Also, if a user is not logged in, then the timezone should be taken from the server settings.
Unless I am missing something …
Waiting for your feedback – thanks for all your replies so far 🙂
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
January 4, 2010 at 2:35 am #328049Hello guy!
The line that returns the timezone of the viewer appears to always return null , because the user did not set timezone, you can test with a account you change the timezone of the user, you’ll see the change of the date adjusting.
1 user says Thank You to Saguaros for this useful post
-
AuthorPosts
This topic contains 4 replies, has 3 voices, and was last updated by Saguaros 14 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum