u.lastlogin shows 31st December 1969

Re: u.lastlogin shows 31st December 1969

by Tim Hunt -
Number of replies: 0
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Well, Moodle stores dates as 'unix time-stamps'. A unix timestamp is just a number, the number of seconds since midnight on 1st January 1970 GMT - so when you display that in your local time-zone, you could well get 31st December 1969.

What you need to do is to treat a lastlogin value of null or 0 as a special case, not a date. (This is most likely a proplem where PHP is automatically converting null to 0.)