Confused by Date/Time entries.

arcadeicons

Member
I have my server set to UTC time,
Joomla set to UTC time,
MYSQL uses system time, so it's is also UTC
php.ini is set to UTC


My users can schedule event start and end times.

- User 1 has Joomla timezone set to USA - Los Angeles (PST = UTC-07:00).
- User 2 has Joomla timezone set to Australia - Perth (AWST = UTC+08:00).

With my date form set to save time as UTC
- User 2 (AWST) sets an event to start/end 05-17-2017 18:00 - 21:00

data saved in SQl

event_start - 2017-05-17 18:00:00
event_end - 2017-05-17 21:00:00

When this time is retrieved from MYSQL and printed using...
Code:
print JHtml::_('date', $event_start, 'F j, Y, g:i a', TRUE, FALSE);
print JHtml::_('date', $event_end, 'F j, Y, g:i a', TRUE, FALSE);

User 1 (Joomla PST) sees - May 17, 2017, 11:00 - 14:00 (Should be 05-17-2017, 03:00 - 06:00)
User 2 (Joomla AWST) sees - May 18, 2017, 02:00 - 05:00 (Should be 05-17-2017 18:00 - 21:00)

None-logged in user (PST computer TZ) sees - May 18, 2017, 18:00 - 21:00 (Should be 05-17-2017, 03:00 - 06:00) - this makes sense as a none-logged person has no time zone settings for Joomla to pull.

I've confirmed both users have correct timezone settings.

It seems that the elements are always posting local time as none-adjusted UTC.
 
Last edited:
OK I've stood on my head trying to work this out but something is very wrong.

I changed my list views to this format (M jS Y - g:ia e) so I can see what is being saved.
I changed my form view to this format (M jS Y - e)

With date fields set to UTC
For the user in the Australian time zone (AWST), they set start/end 05-17-2017 18:00 - 21:00 for their event, the calendar shows +08:00 in the form which is correct from (UTC) to (AWST).

However on post, instead of saving the adjusted (AWST to UTC) dates/times they display as:
May 17th 2017 - 6:00pm UTC - May 17th 2017 - 9:00pm UTC,
inspecting the MYSQL field also shows these same dates and times.


With date fields set to Local
Using the same date and time range set in (AWST)

In list view, instead of showing (AWST) dates/times the dates display as:
May 17th 2017 - 6:00pm GMT - May 17th 2017 - 9:00pm GMT,
inspecting the MYSQL field also shows these same dates and times.

It seems that on post the timezone of the user is not being adjusted for, just the raw numbers from the form are being posted as either UTC or GMT.
 
Last edited:
So how does a user in Australia post a date for an event when they are viewing all times in UTC or PST for that matter?
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top