Monitoring a users log in time?

how do i start with this guys?

Sample run:
[prompt]$ LOGTIME it2015678 <enter>

    User it2015678 is CRUZ Tommy H
    And has logged on to the system for:
                        8  hours
                       12  minutes
    from the time this script was run.

This is homework.