Colin Posted July 18, 2012 Report Share Posted July 18, 2012 Hi again, I have added the last login date to the pilot centre and for what ever reason it is displaying, Last Login: 01/01/1970, Would some one be able to point me in the right direction to change this to show the correct date please. As always any help greatly appreciated Quote Link to comment Share on other sites More sharing options...
Colin Posted July 18, 2012 Author Report Share Posted July 18, 2012 Additionally this is also the case for the last flight flown even though the flight was actually done today: Last Flight: 01/01/1970 Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted July 18, 2012 Moderators Report Share Posted July 18, 2012 you may made a few mistakes here. you need to add the date function to parse the date. <?php echo date(DATE_FORMAT, $userinfo->lastlogin);?> <?php echo date(DATE_FORMAT, $userinfo->lastflight);?> Quote Link to comment Share on other sites More sharing options...
Colin Posted July 18, 2012 Author Report Share Posted July 18, 2012 Tried both of those mate and still says 1970, is it possible that the date may be wrong somewhere or needs setting ? just spit balling, the pop up news on the home page shows the correct date which I suppose blows that theory out of the water, any other suggestions ? Quote Link to comment Share on other sites More sharing options...
flyalaska Posted July 18, 2012 Report Share Posted July 18, 2012 For last flight use, <?php echo date('m/d/Y', strtotime($userinfo->lastpirep));?> That's how I have it on my site. I don't have a Last login displayed on my site, you can try <?php echo date('m/d/Y', strtotime($userinfo->lastlogin));?> Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted July 18, 2012 Moderators Report Share Posted July 18, 2012 If there is no data in the database then this is the default php date will show, check your database as if its in there it should be displayed. Last login is, Last Visit: <?php echo $userinfo->lastlogin?> Quote Link to comment Share on other sites More sharing options...
flyalaska Posted July 18, 2012 Report Share Posted July 18, 2012 If there is no data in the database then this is the default php date will show, check your database as if its in there it should be displayed. Of course, if the Pilot has never logged in our flew a flight. Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted July 18, 2012 Moderators Report Share Posted July 18, 2012 You can add an if else loop there so if they have not logged in you can echo out Never logged in etc, else display the date. Quote Link to comment Share on other sites More sharing options...
Colin Posted July 18, 2012 Author Report Share Posted July 18, 2012 Awesome thanks guys got it sorted ! really appreciated Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.