Problems with date of recent activity

Problems with date of recent activity

by jean-marie baltimore -
Number of replies: 2

Anytime I open moodle (my site or you site) I have the sam problem ! Let's take today's example. The date goes this way in moodle/cours/view.php?id=5 :

your last connexion  (In french votre dernière connection) mardi (tuesday)18 décembre 2002.

The problem is my last connection was mardi 17 décembre and not 18.

I f  I reactivate the account and log again, everything goes well and my last connection is mercredi 18 décembre 2002 5/20 am (yes i'm an early bird)Is it something with the language file

?

Average of ratings: -
In reply to jean-marie baltimore

Re: Problems with date of recent activity

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The first time it says Tuesday 18th December and the second time it says *Wednesday* 18th December?!

Ah! I see it - a new bug introduced in 1.0.7 when I 'fixed' the leading zero on dates. sad

In lib/moodlelib.php, there is this:

            $datestring = gmstrftime($formatnoday, $date + (int)($timezone * 3600));
            $daystring  = str_replace(" 0", "", strftime(" %d", $date));
            $datestring = str_replace("DD", $daystring, $datestring);
but it should be this (middle line has changed):
            $datestring = gmstrftime($formatnoday, $date + (int)($timezone * 3600));
            $daystring  = str_replace(" 0", "", gmstrftime(" %d", $date));
            $datestring = str_replace("DD", $daystring, $datestring);

I'll have that fixed in the next release. In the meantime all dates are being stored correctly - it's just the display of days that is wrong (ie in a different timezone to the rest of the date). We can happily blame Windows for all this mess. smile

Merci beaucoup!

In reply to Martin Dougiamas

Re: Problems with date of recent activity

by Hans de Zwart -
I have changed the line in lib/moodlelib.php
The day is displayed correctly next to the date. Now I still have a problem with the display (and maybe storage) of the proper time.

When, as an admin user, I create an assignment for lets say Sunday the 4th of january at 15:00 I will get as the the 4th of january 10:00 (5 hours earlier). When I then choose 'Update this assignment' I see that the due date there is changed to 4th of january 22:00. When I then just press save I get as a due date 4th of january 05:00.

All of this while still being logged in as the same user with GMT+1 as the time zone.

Any idea of what is going on?