Login Form

#72 – Why the time and date in BF Quiz Component is not same with Joomla Core

Posted in ‘BF Quiz’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Sunday, 29 December 2013 13:27 AEDT
noefk2k
Joomla! version: (2.5.8)
Dear Tamlyn Software, i have an issue for BF Quiz.
When i want to see the dynamic report of my quiz in the backend, and i try to show all Field, i saw in the Date Completed Field is not the exactly same with my joomla time. It's 8 hours late than my joomla time. I've tried to change my time location in joomla config, but it still the same nothing change. Why it can happen? What's the problem?
Please can you fix it.
Thank You
Sunday, 29 December 2013 14:06 AEDT 10'
Tim
BF Quiz Plus 3 Years, BF Survey 12 Months
Hi Nurul,
Joomla stores all dates in UTC format in the database, then uses the timezone setting in either the global config or user profile to adjust the date/time to the local equivalent. The backend dynamic report does not apply the timezone adjustment, what you are seeing is the raw date/time in UTC format.
I'll add to my todo list to investigate the possibility of automatically adjusting this date.

regards

Tim
Follow us on twitter http://twitter.com/tamlynsoftware
Sunday, 29 December 2013 15:47 AEDT
noefk2k
Thankyou for your fast response.
But for now, can you help me how to manually edit the date and time to sync with my local server or joomla core time. You just tell me the trick and i will do it by my self. Thanks again.
Monday, 30 December 2013 22:06 AEDT 10'
Tim
BF Quiz Plus 3 Years, BF Survey 12 Months
Hi Nurul,
Assuming your date was stored in a variable called $mydate, you can use the JHTML date function to convert to a particular format to display, and this will adjust for the timezone set in the global config. For example:

$dateFormat="d-m-Y H:i";
echo JHTML::_('date', $mydate, $dateFormat );

Applying this to the report view is not going to be that easy, as it builds the SQL query dynamically, but perhaps you could apply this to the datefrom and dateto variables so the date range you are selecting in your query matches your timezone.

You might find this article helpful:
http://webamoeba.co.uk/blog/working-with-dates-in-joomla/

regards

Tim
Follow us on twitter http://twitter.com/tamlynsoftware
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.
Go to top