Hello,

in SQL, under users table, there is one attribute for login which represent the last time user has logged in.

How can I read it.. the numbers are like 1361077222 or 1278453347

any hint ? I have been searching for this but I could know find useful result

thanks

Comments

wellsys_world’s picture

Hi kettaneh,

The times are Unix timestamps. You can read them using the PHP date function ( www.php.net/date ).

For example to get the current user's last logged in time you could:

global $user;
$user = user_load($user->uid);
$login_time = $user->login;
print date('d/m/Y', $login_time);

Andy Wells
Web and Drupal Development
Fluid: Drupal in Derby

kettaneh’s picture

Thanks Wellsy,
I found this URL which is doing the same function (online tool) http://www.epochconverter.com/

Thanks a gain