Project

General

Profile

Bug #1166

Sessions availability by datetime seems broken

Added by Yannick Warnier over 9 years ago. Updated over 8 years ago.

Status:
Bug resolved
Priority:
Normal
Category:
-
Target version:
Start date:
30/04/2010
Due date:
% Done:

50%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Using a timezone of Europe/Brussels and defining the time for global news seems to be set to Europe/Brussels time even if my personal time is set to America/Lima

History

#1

Updated by Yannick Warnier over 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Julio Montoya
#2

Updated by Julio Montoya over 9 years ago

This timezone feature works?

This was my test:

I set the chamilo timezone (as an admin) to Americas/Lima (I'm in France so the server date is + 7 hours ).
I set my profile timezone to Americas/Lima.
Then I create a course. I check the my personal agenda.
And the course creation hour hour is in French timezone...

I test also in the system global news and it does not work.

#3

Updated by Julio Montoya over 9 years ago

I mean where it works? Or is not implemented in every tool?

#4

Updated by Julio Montoya over 9 years ago

When I do:

$user_date = api_convert_and_format_date('11-05-2010 11:54:00', DATE_TIME_FORMAT_LONG, 'Europe/Paris');                    
var_dump ($user_date);
$user_date = api_convert_and_format_date('11-05-2010 11:54:00', DATE_TIME_FORMAT_LONG, 'America/Lima');
var_dump ($user_date);

I get the same answer for both of them : May 11, 2010 at 11:54 AM

#5

Updated by Julio Montoya over 9 years ago

  • % Done changed from 0 to 20

I found a wrong variable definition here:

http://code.google.com/p/chamilo/source/detail?r=05c1313601cd403ab4f4fdbdd3c0625f42090d34&repo=classic

Now I get:

string 'May 11, 2010 at 04:54 AM' (length=24)

string 'May 11, 2010 at 11:54 AM' (length=24)

But this is weird... it should be the contrary

#6

Updated by Julio Montoya over 9 years ago

I have an ubuntu 10.04 with PHP 5.3.2-1ubuntu4 with Suhosin-Patch (cli) (built: Apr 9 2010 08:23:39)
My computer time is set to the french timezone

Maybe I'm forgetting some configuration???

#7

Updated by Julio Montoya over 9 years ago

I select the timezone of the user and then I change the date to the correct timezone

http://code.google.com/p/chamilo/source/detail?r=aba896ff8dc3fe93da6decaebff66b16d9ad08ea&repo=classic

#8

Updated by Anonymous over 9 years ago

Hi Julio,

I added comments to your commits. While I agree with the first one, I don't agree with the second one.

To answer your questions, the timezone functionality should work, but yes, it has not been implemented in every tool. There are more information here: http://support.chamilo.org/projects/chamilo-18/wiki/Date_and_time_management

Concerning your comment number 5: it should not be the contrary. Basically when you have your user's timezone set to America/Lima and you call:

$user_date = api_convert_and_format_date('11-05-2010 11:54:00', DATE_TIME_FORMAT_LONG, 'Europe/Paris'); 

it will assume that the datetime you want to convert (11-05-2010 11:54:00) is in the Europe/Paris timezone, and needs to be converted to the America/Lima timezone, so it will substract 7 hours to it (because when it's 11:54 in France, it's 04:54 in Peru).

When you call:

$user_date = api_convert_and_format_date('11-05-2010 11:54:00', DATE_TIME_FORMAT_LONG, 'America/Lima'); 

it needs to convert from the America/Lima timezone to the America/Lima timezone, so the date doesn't change.

#9

Updated by Julio Montoya over 9 years ago

  • % Done changed from 20 to 50

Thanks for the explanation I revert the commits I'm using just the api_convert_and_format_date
See http://code.google.com/p/chamilo/source/detail?r=1162e3f5ef3b71c94633bff22a69bf94d155ba01&repo=classic

#10

Updated by Julio Montoya over 9 years ago

  • Status changed from Assigned to Needs testing
  • Assignee changed from Julio Montoya to Christian Alberto Fasanando Flores
#11

Updated by Yannick Warnier over 8 years ago

  • Status changed from Needs testing to Bug resolved

Also available in: Atom PDF