[drupal-devel] [bug] Last access time reports the epoch instead of 'never'

deekayen drupal-devel at drupal.org
Wed Jun 15 17:31:52 UTC 2005

Issue status update for http://drupal.org/node/24766

 Project:      Drupal
 Version:      cvs
 Component:    user system
 Category:     bug reports
 Priority:     minor
 Assigned to:  deekayen
 Reported by:  puregin
 Updated by:   deekayen
 Status:       patch

the rest of that comment is:

[less than or equal to zero] would be valid times. To track whether
someone visited or not, you'd have to store a new boolean for
Visited/Not Visited.

the [less than or equal to] sign I put in the comment got filtered out
and cropped. Is that a known issue?


Previous comments:

June 10, 2005 - 12:32 : puregin

As site admin, I create a user.  When I look at the user admin page
immediately afterwards, the user shows up with a 'last access' time of
'35 years 24 weeks ago'.   Could we report 'Never' instead of the
epoch, if the last access time is older than the user account?

I seem to recall a similar report, but I couldn't find it after
searching through the issues for user.module, and issues in general.



June 14, 2005 - 02:01 : deekayen

Attachment: http://drupal.org/files/issues/wrong_last_access.png (6.13 KB)

I verified this on WinXP/PHP5.1. Screenshot attached.


June 14, 2005 - 02:22 : deekayen

Attachment: http://drupal.org/files/issues/epochuser.patch (1.17 KB)

Attached patch shows "never" instead of epoch on new users with 0 as
last visited value in the DB


June 15, 2005 - 00:16 : puregin

The patch fixes the problem, thanks.  

Are there other places in Drupal where this kind of message might

Is it possible for the timestamp to be negative under any circumstances
(if so, perhaps the test should be $account->access <= 0 rather than
$account->access == 0)

Regards, Djun


June 15, 2005 - 11:28 : deekayen

I could see how the timestamp might be negative if the DB record were a
page you wanted to back-date, but here we're talking about a triggered
action. I think it would make about as much sense for this to be
negative as it would to see something in your Apache logs date back to

Besides, if the timestamp could be less than 0, you're taking about a
whole new issue of the validity of using epoch to store time instead of
a date/timestamp, because then

More information about the drupal-devel mailing list