-
AuthorPosts
-
issay Friend
issay
- Join date:
- November 2009
- Posts:
- 114
- Downloads:
- 0
- Uploads:
- 22
- Thanks:
- 26
- Thanked:
- 5 times in 1 posts
October 3, 2011 at 2:12 am #169215my site’s date is wrong!! whats the problem. When I go to read the article I find the the correct date.month.year . but the problem is on top corner of the site now its 3 october 2011 . but my site says its 2 october 2011. global servr config is set to my local country.
olso on janews pro time stamp i get an negetive day ago. i asked for help about this before. but the answer i got is not clear. iam using joomla 1.7 . what files i have to change to solve these problems?
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
October 3, 2011 at 3:47 am #416348Hi , good morning
May i ‘ve your site FTP / backend access for checking ?
A screenshot with noted issue should be nice help me for faster working.
Thank you
Viet Vugray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
October 3, 2011 at 6:56 am #416369Date is generated by the following block. PHP function date() is not corrected by the Joomla configs of time offset.
<p class=”ja-day clearfix”>
<?php
echo “<span class=”day”>”.JText::_(strtoupper(date (‘D’))).”</span>”;
echo “<span class=”month”>”.date (‘m’).”</span>”;
echo “<span class=”date”>”.date (‘d’).”</span>”;
echo “<span class=”year”>”.date (‘Y’).”</span>”;
?>
</p>Could you try simply adding at the beginning of /blocks/topbar.php for example:
[PHP]echo date(‘l jS of F Y h:i:s A’);[/PHP]
It will print out the current date and time of your server.jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
vipcory Friendvipcory
- Join date:
- June 2011
- Posts:
- 84
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 18
- Thanked:
- 1 times in 1 posts
October 20, 2011 at 5:27 am #420371mine was fixed with this code:
[PHP]<p class=”ja-day clearfix”>
<?php
echo “<span class=”day”>”.JText::_(strtoupper(JHTML::date(‘now’, ‘D’))).”</span>”;
echo “<span class=”month”>”.JHTML::date(‘now’, ‘m’).”</span>”;
echo “<span class=”date”>”.JHTML::date(‘now’, ‘d’).”</span>”;
echo “<span class=”year”>”.JHTML::date(‘now’, ‘Y’).”</span>”;
?>
</p>[/PHP]issay Friendissay
- Join date:
- November 2009
- Posts:
- 114
- Downloads:
- 0
- Uploads:
- 22
- Thanks:
- 26
- Thanked:
- 5 times in 1 posts
October 20, 2011 at 6:58 am #420389<blockquote>mine was fixed with this code:</blockquote>
but this is not a real solution. because with this it will show ‘today’s date’ even if site is not updated for tha last month!! so its like a clock calender. I need to show last updated day. because i dont update my site every day. so i dont want to show a fake date.
vipcory Friendvipcory
- Join date:
- June 2011
- Posts:
- 84
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 18
- Thanked:
- 1 times in 1 posts
October 20, 2011 at 7:02 am #420392<em>@issay 277207 wrote:</em><blockquote>but this is not a real solution. because with this it will show ‘today’s date’ even if site is not updated for tha last month!! so its like a clock calender. I need to show last updated day. because i dont update my site every day. so i dont want to show a fake date.</blockquote>
Oh ok, yea that part is meant to show only todays date, the time only is suppose to show that last updated time. So I guess someone needs to tweak that for you to show last update date.
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
October 20, 2011 at 7:05 am #420395Hi
I old post i’ve asked please give me for FTP access than i can help you.
Btw, if you are asking datetime in article -> please use created time of article instead.
But if you are talking currenttime .. time() is corrected.Thank you
Viet Vugray Friendgray
- Join date:
- October 2009
- Posts:
- 957
- Downloads:
- 0
- Uploads:
- 17
- Thanks:
- 28
- Thanked:
- 292 times in 230 posts
October 20, 2011 at 8:45 am #420408<em>@issay 277207 wrote:</em><blockquote>but this is not a real solution. because with this it will show ‘today’s date’ even if site is not updated for tha last month!! so its like a clock calender. I need to show last updated day. because i dont update my site every day. so i dont want to show a fake date.</blockquote>
It depends what you want to fix. The above solution is for offsetting current date accroding to the server time offset.If you need to offset the “Last updated” time, find in T3 Freamework plugin’s file /common.php. In that file, find function getLastUpdate and replace it with the code below.
[php]
function getLastUpdate($fieldname=null){
if (!$fieldname) $fieldname = ‘publish_up’;
$db = &JFactory::getDBO();
$query = “SELECT `$fieldname` FROM #__content a ORDER BY `$fieldname` DESC LIMIT 1”;
$db->setQuery($query);
$data = $db->loadObject();
if( $data->$fieldname ){
//return by the format defined in language file with server offset
return JHTML::date($data->$fieldname, JText::_(‘T3_DATE_FORMAT_LASTUPDATE’));
}
return;
}
[/php]
You can change $fieldname = ‘publish_up’; to $fieldname = ‘created’; if you’d like to show last time articles created, but not published.Then, in en-GB.plg_system_jat3.ini find T3_DATE_FORMAT_LASTUPDATE (3rd line) and set it to the format of date/time you need. For instance
[php]T3_DATE_FORMAT_LASTUPDATE=”d.m.Y”[/php] will output “20.10.2011”
[php]T3_DATE_FORMAT_LASTUPDATE=”d F Y”[/php] will output “20 October 2011”
See format parameter here to alter the date/time output.1 user says Thank You to gray for this useful post
-
AuthorPosts
This topic contains 10 replies, has 5 voices, and was last updated by Blaine 13 years ago.
We moved to new unified forum. Please post all new support queries in our New Forum