ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

last_visit returns wrong date (1970)

December 29, 2010 12:45pm

Subscribe [2]
  • #1 / Dec 29, 2010 12:45pm

    Mark Wushu

    58 posts

    Hi there,

    I’m using the variable last_visit for members and this date displays a date of 1, Jan 1970 for members in 2 member groups. For super admins, the date is showing correct.

    In the control panel on the members page, I can see that for members whose dates show 1970, there is no last visited date. Is it because they’ve only logged in once, or do they need to log in via the control panel to instigate this last visit date?

    Thanks,

    Mark

  • #2 / Dec 29, 2010 4:21pm

    Ingmar

    29245 posts

    What version and build of EE are you using? Can you show us a bit more of your code? That said, yes, if they haven’t actually visited at all the corresponding db value will be “0”. If you use that as a date, it will show 1/1/1970 0:00 UTC.

  • #3 / Dec 30, 2010 4:29pm

    Mark Wushu

    58 posts

    Hi Ingmar,

    I’m using the latest EE 2.1.3. It actually doesn’t look like there’s anything wrong with the code, but that as you mentioned, there is no visited date.

    I’ve therefore solved this by using a conditional to only show the date if they HAVE visited:

    {if last_visit}

    Thanks!

    Mark

  • #4 / Dec 30, 2010 4:41pm

    Ingmar

    29245 posts

    Yes, that makes sense. Thanks for sharing your solution with us. Please post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases