?
avatar jjsjjs
jjsjjs
3 Feb 2015

Steps to reproduce the issue

edit your user profile
save
display the user profile

Expected result

so for instance you putted in 1972-06-09

Actual result

the profile then displayes thursday 08 june 1972

System information (as much as possible)

PHP Version 5.3.25
joomla 3.3.6

Additional comments

nb why is the way of input not selectable? so change from yyyy/mm/dd(us) to dd/mm/yyyy(eu)

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar jjsjjs jjsjjs - open - 3 Feb 2015
avatar Bakual
Bakual - comment - 3 Feb 2015

What timezone do you have set for your server and your user?

avatar brianteeman
brianteeman - comment - 3 Feb 2015

We have had this many times before and it has always been down to the server timezone


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5954.
avatar brianteeman brianteeman - change - 3 Feb 2015
Status New Information Required
avatar joomdonation
joomdonation - comment - 3 Feb 2015

Right now, the Date of birth field used SERVER_UTC filter and it cause the issue when user timezone is different from server timezone.

To solve this issue, I think we can change the field to use USER_UTC filter. To do that, just change filter="server_utc" in this line https://github.com/joomla/joomla-cms/blob/staging/plugins/user/profile/profiles/profile.xml#L110

To filter="user_utc"

Could you test it?

avatar Bakual
Bakual - comment - 3 Feb 2015

user_utc almost certainly is wrong. That would mean there is a different date shown for each user depending on their settings.
The date should always be stored and shown both based on the server timezone.

The issue most likely is that it is shown based on the user timezone, and not based on the server timezone.

avatar jjsjjs
jjsjjs - comment - 3 Feb 2015

Hello Brian and Thomas,
thank you for your reply.

I see that the server time zone is set to Amsterdam.
Were exactly can i find the other one for the user? Can't find it this
quick.

Thank You!

Brian Teeman schreef op 3-2-2015 om 11:27:

We have had this many times before and it has always been down to the
server timezone


_This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at
issues.joomla.org/joomla-cms/5954
http://issues.joomla.org/tracker/joomla-cms/5954.


Reply to this email directly or view it on GitHub
#5954 (comment).

avatar jjsjjs
jjsjjs - comment - 3 Feb 2015

Hello,

ok found the user setting.
So now both back-end and user are on Amsterdam.....issue remains

I will try when front end parameters are off.

Thomas Hunziker schreef op 3-2-2015 om 18:26:

user_utc almost certainly is wrong. That would mean there is a
different date shown for each user depending on their settings.
The date should always be stored and shown both based on the server
timezone.

The issue most likely is that it is shown based on the user timezone,
and not based on the server timezone.


Reply to this email directly or view it on GitHub
#5954 (comment).

avatar jjsjjs
jjsjjs - comment - 3 Feb 2015

Ok set the server time zone on UTC.
Now it is ok.

And it seems to make no difference at all where the front-end user
setting is set to.
Seems like the front-end setting has totally no influnce/ or is not working
Strange

But thanks!

Maybe you know why the front end setting makes no difference ?

Thomas Hunziker schreef op 3-2-2015 om 18:26:

user_utc almost certainly is wrong. That would mean there is a
different date shown for each user depending on their settings.
The date should always be stored and shown both based on the server
timezone.

The issue most likely is that it is shown based on the user timezone,
and not based on the server timezone.


Reply to this email directly or view it on GitHub
#5954 (comment).

avatar Bakual
Bakual - comment - 3 Feb 2015

All I know is that Joomla stores dates as UTC in the database. That means it takes the date from the form and adjusts the timezone from the server or user settings (depends on code) to UTC. Then it stores the date. When it's shown again on a page, it again applies the timezone shift depending on the requested timezone (server or suer, depends on code).
That usually works fine when we are talking about date/time constructs. It can be a bit funny when we only have the date part, and especially for birthdays where you don't want to have the date adjusted to timezones. So this may be the issue here.

However I haven't looked at the specific code and can't say you why it fails exactly in this case.

avatar jjsjjs
jjsjjs - comment - 3 Feb 2015

Thank you Thomas for your reply.

ok no problem.
At least you cleared it up how it is stored, so i understand.
It's working ok now in this way, so i leave it for now.
Thanks!
Thomas Hunziker schreef op 3-2-2015 om 22:24:

All I know is that Joomla stores dates as UTC in the database. That
means it takes the date from the form and adjusts the timezone from
the server or user settings (depends on code) to UTC. Then it stores
the date. When it's shown again on a page, it again applies the
timezone shift depending on the requested timezone (server or suer,
depends on code).
That usually works fine when we are talking about date/time
constructs. It can be a bit funny when we only have the date part, and
especially for birthdays where you don't want to have the date
adjusted to timezones. So this may be the issue here.

However I haven't looked at the specific code and can't say you why it
fails exactly in this case.


Reply to this email directly or view it on GitHub
#5954 (comment).

avatar brianteeman brianteeman - change - 3 Feb 2015
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2015-02-03 22:33:39
Closed_By brianteeman
avatar brianteeman brianteeman - change - 3 Feb 2015
Closed_Date 2015-02-03 22:33:39 2015-02-03 22:33:40
avatar brianteeman brianteeman - close - 3 Feb 2015
avatar zero-24 zero-24 - close - 3 Feb 2015
avatar brianteeman brianteeman - close - 3 Feb 2015
avatar joomdonation
joomdonation - comment - 3 Feb 2015

@Bakual : user_utc is correct. When we set it to user_utc

  • The date user choose will be stored in database in UTC timezone

  • Then when it is displayed again, it will be displayed in that user timezone. So it is correct.

I have looked at the code and I almost certain that it works.

avatar joomdonation
joomdonation - comment - 3 Feb 2015

Settings server timezone to UTC will solve the issue, yes, but it will not solve this issue completely because many websites will have timezone set to different timezone, and this issue will still happen with other sites.

To solve this issue completely, we need to set filter to user_utc like I mentioned before. The date will be displayed correctly and not depends on server timezone settings of the site anymore.

avatar jjsjjs
jjsjjs - comment - 4 Feb 2015

Well, i don't completely understand why the option is there to change
the server time zone in back-end, when Joomla always stores it in UTC.
Why is it then not a fixed value in backend?

Tuan Pham Ngoc schreef op 4-2-2015 om 0:25:

Settings server timezone to UTC will solve the issue, yes, but it will
not solve this issue completely because many websites will have
timezone set to different timezone, and this issue will still happen
with other sites.

To solve this issue completely, we need to set filter to user_utc like
I mentioned before. The date will be displayed correctly and not
depends on server timezone settings of the site anymore.


Reply to this email directly or view it on GitHub
#5954 (comment).

avatar Bakual
Bakual - comment - 4 Feb 2015

Well, i don't completely understand why the option is there to change
the server time zone in back-end, when Joomla always stores it in UTC.
Why is it then not a fixed value in backend?

Because server timezone may be different from UTC and dates created by PHP (like current date and the like) would be calculated wrong then.

avatar jjsjjs
jjsjjs - comment - 4 Feb 2015

Also in Dutch there is another bug, there is a line displayed which
should not be there.
This line is visible on the page where you edit the profile, but is also
displayed when just viewing the profile

it is displayed above the line date of birth (Geboortedatum:) and behind
it the date

Tuan Pham Ngoc schreef op 4-2-2015 om 0:25:

Settings server timezone to UTC will solve the issue, yes, but it will
not solve this issue completely because many websites will have
timezone set to different timezone, and this issue will still happen
with other sites.

To solve this issue completely, we need to set filter to user_utc like
I mentioned before. The date will be displayed correctly and not
depends on server timezone settings of the site anymore.


Reply to this email directly or view it on GitHub
#5954 (comment).

avatar jjsjjs
jjsjjs - comment - 4 Feb 2015

Ok thank you !

Thomas Hunziker schreef op 4-2-2015 om 12:00:

Well, i don't completely understand why the option is there to change
the server time zone in back-end, when Joomla always stores it in UTC.
Why is it then not a fixed value in backend?

Because server timezone may be different from UTC and dates created by
PHP (like current date and the like) would be calculated wrong then.


Reply to this email directly or view it on GitHub
#5954 (comment).

avatar joomdonation
joomdonation - comment - 4 Feb 2015

Sorry Thomas, please ignore my comments about user_utc, it is incorrect, Checking it more show me that server_utc should be correct. Don't have any clue why it doesn't work for @jjsjjs .

avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment